From: Eevee Date: Sun, 26 Sep 2010 04:52:46 +0000 (-0700) Subject: Make Post.author an innerjoin. X-Git-Tag: veekun-promotions/2010101501^0 X-Git-Url: http://git.veekun.com/zzz-spline-forum.git/commitdiff_plain/c213aa63c689e52a29342fa3662c34427cdc755e Make Post.author an innerjoin. --- diff --git a/splinext/forum/model/__init__.py b/splinext/forum/model/__init__.py index c913561..b8f9225 100644 --- a/splinext/forum/model/__init__.py +++ b/splinext/forum/model/__init__.py @@ -87,4 +87,4 @@ Thread.first_post = relation(Post, primaryjoin=and_(Post.thread_id == Thread.id, # XXX THIS WILL NEED TO CHANGE when posts can be deleted! Or change what 'position' means Thread.last_post = relation(Post, primaryjoin=and_(Post.thread_id == Thread.id, Post.position == Thread.post_count), foreign_keys=[Post.thread_id], innerjoin=True, uselist=False, viewonly=True) -Post.author = relation(users_model.User, backref='posts') +Post.author = relation(users_model.User, backref='posts', innerjoin=True)