'method to create object before post
:param data:
:param view_kwargs:
:return:'

def before_create_object(self, data, view_kwargs):

    if (view_kwargs.get('user_id') is not None):
        user = safe_query(self, User, 'id', view_kwargs['user_id'], 'user_id')
        data['user_id'] = user.id
