@csrf_exempt
@gzip_page
@require_sync_session
@api_handle_error_with_json
def device_download(data, session):
 zone = session.client_device.get_zone()
 devicezones = list(DeviceZone.all_objects.filter(zone=zone, device__in=data['devices']))
 devices = [devicezone.device for devicezone in devicezones]
 session.models_downloaded += (len(devices) + len(devicezones))
 return JsonResponse({'devices': serialize((devices + devicezones), dest_version=session.client_version, ensure_ascii=False)})

@ csrf_exempt @ gzip_page @ require_sync_session @ api_handle_error_with_json def device_download ( data , session ) : zone = session . client_device . get_zone ( ) devicezones = list ( DeviceZone . all_objects . filter ( zone = zone , device__in = data [ 'devices' ] ) ) devices = [ devicezone . device for devicezone in devicezones ] session . models_downloaded += ( len ( devices ) + len ( devicezones ) ) return JsonResponse ( { 'devices' : serialize ( ( devices + devicezones ) , dest_version = session . client_version , ensure_ascii = False ) } )
this device is having its own devices downloaded .