# HG changeset patch # User Brian Neal # Date 1300841046 0 # Node ID 0398aae488079191b96510d011383944abdf920a # Parent e0523e17ea431e1dc9cdce20addc56f8d15f4dcc Another tweak to the forum feeds query; see #191. diff -r e0523e17ea43 -r 0398aae48807 gpp/forums/feeds.py --- a/gpp/forums/feeds.py Mon Mar 21 00:39:52 2011 +0000 +++ b/gpp/forums/feeds.py Wed Mar 23 00:44:06 2011 +0000 @@ -67,14 +67,15 @@ posts = [] for forum_id in public_forum_ids: posts.extend(list(Post.objects.filter( - topic__forum__id=forum_id).order_by('-creation_date').select_related(depth=2)[:30])) + topic__forum=forum_id).order_by('-creation_date').select_related( + 'topic', 'user', 'topic__forum')[:30])) posts.sort(key=lambda x: x.creation_date, reverse=True) return posts[:30] else: return Post.objects.filter(topic__forum__id=obj.id).order_by( - '-creation_date').select_related(depth=2)[:30] + '-creation_date').select_related('topic', 'user', 'topic__forum')[:30] def item_title(self, item): return item.topic.name