Exemplo n.º 1
0
 def get(self, n=1):
     #[timestamp,content, url , count ]
     self.set_header('Content-Type', 'application/json; charset=UTF-8')
     user_id = self.current_user_id
     count = history_count(user_id)
     page , limit , offset = page_limit_offset(
         '/history-%s',
         count,
         n,
         15
     )
     _history = history_get(user_id, offset, limit)
     self.finish(json.dumps(_history + [[count, int(n), limit]]))
Exemplo n.º 2
0
 def GET(self, n=1):
     count = album_count()
     page, limit, offset = page_limit_offset('/list/%s', count, n, 50)
     album_li = album_latest(limit, offset)
     return self.render(album_li=album_li, page=page)