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 not device.carrier: device.carrier = "Unknown" DeviceCarriers.increment(device.carrier)
def get(self): db.delete(DeviceCarriers.all().fetch(1000)) total = (Device.all().count() / 10) + 1 for x in xrange(total): offset = x * 10 taskqueue.add(url='/tasks/AggregateCarriersWorker', params={'offset': offset})
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 html(self): self.render({ 'carrier_data_len': len(DeviceCarriers.generateGraphData()), 'carrier_data': DeviceCarriers.generateGraphData() })
def json(self): json = simplejson.dumps(DeviceCarriers.generateGraphData()) self.response.out.write(json)