def post(self): commit = bool(self.request.get('commit')) delete = bool(self.request.get('delete')) if commit == delete: return self._error('Invalid request') try: log = ReportLog.get_by_id(int(self.request.get('id', 0))) except: return self._error('Invalid log id "%s"' % self.request.get('id', '')) if not log: return self._error('No log found for "%s"' % self.request.get('id', '')) if commit: log.commit = True log.put() schedule_report_process(log) else: log.delete() self.response.out.write( template.render('report_logs.html', { 'logs': ReportLog.all(), 'status': 'OK' }))
def post(self): self.response.headers['Content-Type'] = 'text/plain; charset=utf-8' logs = ReportLog.all() limit = 50 count = 0 for log in logs.fetch(limit): log.commit = True log.put() schedule_report_process(log) count += 1 if count == limit: schedule_commit_all() self.response.out.write('OK')
def post(self): commit = bool(self.request.get('commit')) delete = bool(self.request.get('delete')) if commit == delete: return self._error('Invalid request') try: log = ReportLog.get_by_id(int(self.request.get('id', 0))) except: return self._error('Invalid log id "%s"' % self.request.get('id', '')) if not log: return self._error('No log found for "%s"' % self.request.get('id', '')) if commit: log.commit = True log.put() schedule_report_process(log) else: log.delete() self.response.out.write(template.render('report_logs.html', {'logs': ReportLog.all(), 'status': 'OK'}))
def post(self): commit = bool(self.request.get("commit")) delete = bool(self.request.get("delete")) if commit == delete: return self._error("Invalid request") try: log = ReportLog.get_by_id(int(self.request.get("id", 0))) except: return self._error('Invalid log id "%s"' % self.request.get("id", "")) if not log: return self._error('No log found for "%s"' % self.request.get("id", "")) if commit: log.commit = True log.put() schedule_report_process(log) else: log.delete() self.response.out.write( template.render("report_logs.html", {"logs": ReportLog.all().fetch(20), "status": "OK"}) )
def get(self): self.response.out.write(template.render('report_logs.html', {'logs': ReportLog.all()}))
def get(self): self.response.out.write( template.render('report_logs.html', {'logs': ReportLog.all()}))
def get(self): self.response.out.write(template.render("report_logs.html", {"logs": ReportLog.all().fetch(20)}))