Skip to content
Permalink
master
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
@staticmethod
def factory(role):
if role is not None:
if role.lower() == "staff":
return Staff()
elif role.lower() == "user":
return User()
else:
return None
You can’t perform that action at this time.