Add more complete example

This commit is contained in:
Konsta Vesterinen
2014-01-21 15:08:26 +02:00
parent 65c7ab6d6f
commit 8e556b05e3

View File

@@ -70,6 +70,15 @@ Simple aggregates
thread_id = sa.Column(sa.Integer, sa.ForeignKey(Thread.id))
thread = Thread(name=u'SQLAlchemy development')
thread.comments.append(Comment(u'Going good!'))
thread.comments.append(Comment(u'Great new features!'))
session.add(thread)
session.commit()
thread.comment_count # 2
Custom aggregate expressions