def walking_into_class(cls, initial_obj, obj, field_name, model, request=None): if field_name in ('students', 'teachers', 'courses_created_of'): return WALKING_STOP elif field_name in ('owner', 'completion_badge', 'created_from'): return ONLY_REFERENCE elif field_name == 'unit': return WALKING_INTO_CLASS update_the_serializer(obj, field_name)
def walking_into_class(cls, initial_obj, obj, field_name, model, request=None): if field_name in ('pages_created_of', 'website', 'website_initial_page'): return WALKING_STOP elif field_name == 'created_from': return ONLY_REFERENCE elif field_name == 'last_editor': return WALKING_INTO_CLASS update_the_serializer(obj, field_name)
def walking_into_class(cls, initial_obj, obj, field_name, model, request=None): if field_name in ('initial_page', 'websites_created_of'): return WALKING_STOP elif field_name in ('original_website', 'owners'): return ONLY_REFERENCE elif field_name == 'page': return WALKING_INTO_CLASS update_the_serializer(obj, field_name)
def walking_into_class(cls, initial_obj, obj, field_name, model, request=None): if field_name == 'assignment': return ONLY_REFERENCE update_the_serializer(obj, field_name)
def walking_into_class(cls, initial_obj, obj, field_name, model, request=None): if field_name == 'kq': return ONLY_REFERENCE elif field_name == 'criteria': return WALKING_INTO_CLASS update_the_serializer(obj, field_name)
def walking_into_class(cls, initial_obj, obj, field_name, model, request=None): if field_name == 'unit': return ONLY_REFERENCE elif field_name in ('attachment', 'question', 'peerreviewassignment'): return WALKING_INTO_CLASS update_the_serializer(obj, field_name)
def walking_into_class(cls, initial_obj, obj, field_name, model, request=None): if field_name == 'course': return WALKING_STOP elif field_name == 'knowledgequantum': return WALKING_INTO_CLASS update_the_serializer(obj, field_name)