def post(self): offset = int(self.request.get('offset')) devices = Device.all().fetch(10, offset) for device in devices: logging.debug("Device: %s" % device.key().name()) if device.type: DeviceAggregate.increment(device.type)
def get(self): tpl_values = { 'device_count': Device.getCount(), 'devices_count': DeviceAggregate.getKeyCount(), 'device_data': DeviceAggregate.generateGraphData(), 'carrier_count': DeviceCarriers.getKeyCount(), 'country_count': DeviceCountries.getKeyCount(), } self.render(tpl_values)
def get(self): db.delete(DeviceAggregate.all().fetch(400)) total = (Device.all().count() / 10) + 1 for x in xrange(total): offset = x * 10 taskqueue.add(url='/tasks/AggregateDevicesWorker', params={'offset': offset})