Jeg ville ikke gøre det i en forespørgsel, men snarere oprette den ønskede gruppering på pythonsiden:
# 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