Updates to_model to use fields
This commit is contained in:
parent
1610d81ce6
commit
a85043b351
7 changed files with 78 additions and 66 deletions
|
@ -25,3 +25,8 @@ from .site import SiteSettings, SiteInvite, PasswordReset
|
|||
cls_members = inspect.getmembers(sys.modules[__name__], inspect.isclass)
|
||||
activity_models = {c[1].activity_serializer.__name__: c[1] \
|
||||
for c in cls_members if hasattr(c[1], 'activity_serializer')}
|
||||
|
||||
def to_activity(activity_json):
|
||||
''' link up models and activities '''
|
||||
activity_type = activity_json.get('type')
|
||||
return activity_models[activity_type].to_activity(activity_json)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue