Skip to content
Go to file
Cannot retrieve contributors at this time
20 lines (15 sloc) 406 Bytes
""" ProfileFacotry"""
from user import User
from staff import Staff
class UserFactory:
# FACTORY class
# Group of Four: FACTORY METHOD
def factory(role):
if role is not None:
if role.lower() == "staff":
return Staff()
elif role.lower() == "user":
return User()
return None
You can’t perform that action at this time.