@csrf_exempt
@require_sync_session
@api_handle_error_with_json
def device_upload(data, session):
 try:
  result = save_serialized_models(data.get('devices', '[]'), src_version=session.client_version)
 except Exception as e:
  logging.debug(('Exception uploading devices (in api_views): %s' % e))
  result = {'error': e.message, 'saved_model_count': 0}
 session.models_uploaded += result['saved_model_count']
 session.errors += result.has_key('error')
 return JsonResponse(result)

@ csrf_exempt @ require_sync_session @ api_handle_error_with_json def device_upload ( data , session ) : try : result = save_serialized_models ( data . get ( 'devices' , '[]' ) , src_version = session . client_version ) except Exception as e : logging . debug ( ( 'Exception uploading devices (in api_views): %s' % e ) ) result = { 'error' : e . message , 'saved_model_count' : 0 } session . models_uploaded += result [ 'saved_model_count' ] session . errors += result . has_key ( 'error' ) return JsonResponse ( result )
this device is getting device-related objects from another device .