def get(self): requests = query.current_requests() doc = common.Document(title='pushmaster: requests') doc.body( T.h2(('Current Requests (%d)' % len(requests)) if len(requests) > 5 else 'Current Requests'), common.request_list(requests) if requests else T.span('There are no requests at present.'), T.div(common.bookmarklet(self.hostname)), ) doc.serialize(self.response.out)
def get(self): """List requests""" requests = query.current_requests() response = {'requests': [request.json for request in requests]} self.response.out.write(json.dumps(response))