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.version: DeviceVersions.increment(device.version)
def get(self): db.delete(DeviceVersions.all().fetch(400)) total = (Device.all().count() / 10) + 1 for x in xrange(total): offset = x * 10 taskqueue.add(url='/tasks/AggregateVersionsWorker', params={'offset': offset})
def html(self): self.render({ 'version_data': DeviceVersions.generateGraphData(), 'unknown_version_data': UnknownVersions.generateGraphData(), 'version_table_data': DeviceVersions.generateGraphData() + UnknownVersions.generateGraphData(), })
def json(self): json = simplejson.dumps(DeviceVersions.generateGraphData()) self.response.out.write(json)