'before create method for object
:param data:
:param view_kwargs:
:return:'

def before_create_object(self, data, view_kwargs):

    event = None
    if view_kwargs.get('event_id'):
        event = safe_query(self, Event, 'id', view_kwargs['event_id'], 'event_id')
    elif view_kwargs.get('event_identifier'):
        event = safe_query(self, Event, 'identifier', view_kwargs['event_identifier'], 'event_identifier')
    if event:
        data['event_id'] = event.id
