def get_device_counters(**kwargs):
 assert ((('zone' in kwargs) + ('devices' in kwargs)) == 1), 'Must specify zone or devices, and not both.'
 from ..devices.models import Device
 devices = (kwargs.get('devices') or Device.all_objects.by_zone(kwargs['zone']))
 device_counters = {}
 for device in list(devices):
  if (device.id not in device_counters):
   device_counters[device.id] = device.get_counter_position()
   if device.is_own_device():
    cnt = 0
    for Model in _syncing_models:
     cnt += Model.all_objects.filter((Q(counter__isnull=True) | Q(signature__isnull=True))).count()
    device_counters[device.id] += cnt
 return device_counters

def get_device_counters ( ** kwargs ) : assert ( ( ( 'zone' in kwargs ) + ( 'devices' in kwargs ) ) == 1 ) , 'Must specify zone or devices, and not both.' from . . devices . models import Device devices = ( kwargs . get ( 'devices' ) or Device . all_objects . by_zone ( kwargs [ 'zone' ] ) ) device_counters = { } for device in list ( devices ) : if ( device . id not in device_counters ) : device_counters [ device . id ] = device . get_counter_position ( ) if device . is_own_device ( ) : cnt = 0 for Model in _syncing_models : cnt += Model . all_objects . filter ( ( Q ( counter__isnull = True ) | Q ( signature__isnull = True ) ) ) . count ( ) device_counters [ device . id ] += cnt return device_counters
get device counters .