Guest User

Untitled

a guest
Dec 9th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. def recent_posts(update = False):
  2. key = "recent"
  3. posts,age = age_get(key)
  4.  
  5. if posts is None or update:
  6. posts = db.GqlQuery("SELECT * FROM Post ORDER BY created DESC LIMIT 10")
  7. posts = list(posts)
  8. age_set(key,posts)
  9. return posts,age
  10.  
  11. def recent_posts(update = False,limit = 10):
  12. key = "recent"
  13. posts,age = age_get(key)
  14.  
  15. if posts is None or update:
  16. posts = db.GqlQuery("SELECT * FROM Post ORDER BY created" +
  17. "DESC LIMIT %s" % limit)
  18. posts = list(posts)
  19. age_set(key,posts)
  20. return posts,age
Add Comment
Please, Sign In to add comment