<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Django annoyances: no reverse select_related</title>
	<atom:link href="http://blog.affien.com/archives/2009/05/30/django-annoyances-no-reverse-select_related/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.affien.com/archives/2009/05/30/django-annoyances-no-reverse-select_related/</link>
	<description>A few thoughts</description>
	<lastBuildDate>Tue, 02 Mar 2010 14:24:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Bas Westerbaan</title>
		<link>http://blog.affien.com/archives/2009/05/30/django-annoyances-no-reverse-select_related/comment-page-1/#comment-178399</link>
		<dc:creator>Bas Westerbaan</dc:creator>
		<pubDate>Sun, 31 May 2009 12:07:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.affien.com/?p=380#comment-178399</guid>
		<description>Yeah, that is what I was thinking about.  However, it&#039;s still a waste to have to fetch all comments, when possibly only displaying 30 of them.  (You changed the direction of the reference in your code).</description>
		<content:encoded><![CDATA[<p>Yeah, that is what I was thinking about.  However, it&#8217;s still a waste to have to fetch all comments, when possibly only displaying 30 of them.  (You changed the direction of the reference in your code).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://blog.affien.com/archives/2009/05/30/django-annoyances-no-reverse-select_related/comment-page-1/#comment-178398</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Sun, 31 May 2009 09:31:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.affien.com/?p=380#comment-178398</guid>
		<description>You can work around it using select_related to retrieve comments to the pages, and then combine them in the python code using groupby.

from django.utils.itercompat import groupby

comments = Comment.objects.filter(**kwargs).select_related(&#039;page&#039;)
pages_with_comments = dict(groupby(comments, lambda t: t.page))</description>
		<content:encoded><![CDATA[<p>You can work around it using select_related to retrieve comments to the pages, and then combine them in the python code using groupby.</p>
<p>from django.utils.itercompat import groupby</p>
<p>comments = Comment.objects.filter(**kwargs).select_related(&#8216;page&#8217;)<br />
pages_with_comments = dict(groupby(comments, lambda t: t.page))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Scott</title>
		<link>http://blog.affien.com/archives/2009/05/30/django-annoyances-no-reverse-select_related/comment-page-1/#comment-178397</link>
		<dc:creator>Mike Scott</dc:creator>
		<pubDate>Sat, 30 May 2009 18:08:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.affien.com/?p=380#comment-178397</guid>
		<description>Its something thats been bugging me for quite some time, and just lately its become quite a nusance. If django gracefully degraded and gave you appropriate manual controls for this exact sort of thing it wouldn&#039;t  be so bad. But I can&#039;t seem to work that bit out quite yet.</description>
		<content:encoded><![CDATA[<p>Its something thats been bugging me for quite some time, and just lately its become quite a nusance. If django gracefully degraded and gave you appropriate manual controls for this exact sort of thing it wouldn&#8217;t  be so bad. But I can&#8217;t seem to work that bit out quite yet.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
