Ejemplo n.º 1
0
 def GET(self, post_id):
     comm_idxs = r.get_list(r.post_key(post_id, "comm.list", raw=True))
     comments = []
     for cid in comm_idxs:
         body = r.comm(post_id, cid)
         date = r.comm_key(post_id, cid, "comm_date")
         comments.append({"url": cid, "comm_body": body, "comm_date": date})
     ctx = {"post_id": post_id, "comments": comments}
     return {"ctx": ctx}
Ejemplo n.º 2
0
 def GET(self, post_id):
     comm_idxs = r.get_list(r.post_key(post_id, 'comm.list', raw=True))
     comments = []
     for cid in comm_idxs:
         body = r.comm(post_id, cid)
         date = r.comm_key(post_id, cid, 'comm_date')
         comments.append({'url': cid, 'comm_body': body, 'comm_date': date})
     ctx = {'post_id': post_id, 'comments': comments}
     return {'ctx': ctx}
Ejemplo n.º 3
0
 def GET(self):
     num = r.len("post.list")
     post_idxs = r.get_list("post.list")
     posts = []
     for pid in post_idxs:
         title = r.post_key(pid, "post_title")
         date = r.post_key(pid, "post_date")
         posts.append({"post_title": title, "post_date": date, "url": pid})
     ctx = {"num_posts": num, "posts": posts}
     return {"ctx": ctx}
Ejemplo n.º 4
0
 def GET(self):
     num = r.len('post.list')
     post_idxs = r.get_list('post.list')
     posts = []
     for pid in post_idxs:
         title = r.post_key(pid, 'post_title')
         date = r.post_key(pid, 'post_date')
         posts.append({'post_title': title, 'post_date': date, 'url': pid})
     ctx = {'num_posts': num, 'posts': posts}
     return {'ctx': ctx}