मैं इसे एक प्रश्न में नहीं करूँगा, बल्कि अजगर पक्ष पर वांछित समूह बनाऊंगा:
# get desired posts (add your filters etc)
posts = session.query(Post).order_by(Post.time)
# create a dictionary, where key is the date(-only), and values are the posts of that day
from collections import defaultdict
grouped = defaultdict(list)
for post in posts:
dat = post.time.date()
grouped[dat].append(post)
# iterate over new grouped structure
for dat, posts in sorted(grouped.items()):
print dat
for post in posts:
print ' ', post