Ejemplo n.º 1
0
    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'
            }))
Ejemplo n.º 2
0
 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')
Ejemplo n.º 3
0
    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'}))
Ejemplo n.º 4
0
    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"})
        )
Ejemplo n.º 5
0
 def get(self):
     self.response.out.write(template.render('report_logs.html', {'logs': ReportLog.all()}))
Ejemplo n.º 6
0
 def get(self):
     self.response.out.write(
         template.render('report_logs.html', {'logs': ReportLog.all()}))
Ejemplo n.º 7
0
 def get(self):
     self.response.out.write(template.render("report_logs.html", {"logs": ReportLog.all().fetch(20)}))