Skip to content

Instantly share code, notes, and snippets.

/orbi.py Secret

Created August 27, 2014 17:54
Show Gist options
  • Save anonymous/e09737bb0bfb05b5730c to your computer and use it in GitHub Desktop.
Save anonymous/e09737bb0bfb05b5730c to your computer and use it in GitHub Desktop.
import random
from orbi import Post
posts = Post.query.order_by(Post.created_at.desc())[:100]
for i in range(3):
print random.choice(posts)
'''결과
<Post id=4816297>
<Post id=4816634>
<Post id=4815873>'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment