예제 #1
0
 def list(self, d):
     page, max, offset = tools.paging_params(self.request)
     readable_id = self.request.get('readable_id')
     quotes = Quote.Fetch(self.user, readable_id=readable_id, limit=max, offset=offset)
     self.set_response({
         'quotes': [q.json() for q in quotes]
     }, success=True)
예제 #2
0
 def list(self, d):
     page, max, offset = tools.paging_params(self.request)
     favorites = self.request.get_range('favorites') == 1
     with_notes = self.request.get_range('with_notes') == 1
     unread = self.request.get_range('unread') == 1
     read = self.request.get_range('read') == 1
     since = self.request.get('since')  # ISO
     readables = Readable.Fetch(self.user, favorites=favorites,
                                unread=unread, read=read,
                                with_notes=with_notes, since=since,
                                limit=max, offset=offset)
     self.set_response({
         'readables': [r.json() for r in readables]
     }, success=True)
예제 #3
0
 def list(self, d):
     page, max, offset = tools.paging_params(self)
     users = User.query().fetch(limit=max, offset=offset)
     self.success = True
     self.set_response({'users': [u.json() for u in users]})
예제 #4
0
 def list(self, d):
     page, max, offset = tools.paging_params(self.request)
     events = Event.Fetch(self.user, limit=max, offset=offset)
     self.set_response({
         'events': [event.json() for event in events]
     }, debug=True, success=True)