示例#1
0
 def pre_create(self, data, files, acceptable, required, exclude, request, request_kwargs, or_get):
     if request.oauth2_user.pk:
         data['from'] = user_public_resource(request.oauth2_user.pk)
     data['client'] = request.oauth2_authorization_info.client_pk
     if 'link' in data:
         link_data = data['link']
         if link_data[0] == '{':
             link_data = json.loads(link_data)
         else:
             link_data = {'url': link_data}
         data['link'] = link_public_resource.create(link_data)
     return data, files
示例#2
0
 def pre_create(self, data, files, acceptable, required, exclude, request, request_kwargs, or_get):
     data['from'] = user_public_resource(request.oauth2_user.pk)
     data['post'] = self.pk_to_object_id(request_kwargs['pk'])
     return data, files
示例#3
0
 def pre_create(self, data, files, acceptable, required, exclude, request, request_kwargs, or_get):
     data['from'] = user_public_resource(request.oauth2_user.pk)
     data['client'] = request.oauth2_authorization_info.client_pk
     return data, files