<?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: Recursion in Django templates</title>
	<atom:link href="http://blog.elsdoerfer.name/2008/01/22/recursion-in-django-templates/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.elsdoerfer.name/2008/01/22/recursion-in-django-templates/</link>
	<description>Contributing back to the Google Index.</description>
	<lastBuildDate>Tue, 07 Sep 2010 16:01:17 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jérémie</title>
		<link>http://blog.elsdoerfer.name/2008/01/22/recursion-in-django-templates/comment-page-1/#comment-1318</link>
		<dc:creator>Jérémie</dc:creator>
		<pubDate>Fri, 02 Jul 2010 10:13:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elsdoerfer.info/2008/01/22/recursion-in-django-templates/#comment-1318</guid>
		<description>Hi,

This is exactly what I need, but I can&#039;t make it work...

I put the code in a template which I included in my main template, the first include is fine, but it doesn&#039;t go further.
It react like if &quot;post&quot; from &quot;{% for post in thread %} &quot; is empty (but it&#039;s not) and doesn&#039;t go inside the loop.

Does anybody have this kind of trouble?

thanks.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>This is exactly what I need, but I can't make it work...</p>
<p>I put the code in a template which I included in my main template, the first include is fine, but it doesn't go further.<br />
It react like if "post" from "{% for post in thread %} " is empty (but it's not) and doesn't go inside the loop.</p>
<p>Does anybody have this kind of trouble?</p>
<p>thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://blog.elsdoerfer.name/2008/01/22/recursion-in-django-templates/comment-page-1/#comment-1184</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Mon, 10 May 2010 21:22:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elsdoerfer.info/2008/01/22/recursion-in-django-templates/#comment-1184</guid>
		<description>Awesome work. Was so proud of my recursion in the view and got stuck on the rendering of it in the template. Can&#039;t believe that you have to assign the filename to a variable but it works just like you said. Thanks, you&#039;re a legend!  :-)

PS! I&#039;m using it on a production system but just for admin/cms stuff, so I guess there&#039;s no real harm there. Wanted to have a menu using this (one of those nice superfish-style dropdown menus), but I suspect that that would REALLY kill the server (having to resolve this recursion on every single page call).</description>
		<content:encoded><![CDATA[<p>Awesome work. Was so proud of my recursion in the view and got stuck on the rendering of it in the template. Can't believe that you have to assign the filename to a variable but it works just like you said. Thanks, you're a legend!  <img src='http://blog.elsdoerfer.name/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>PS! I'm using it on a production system but just for admin/cms stuff, so I guess there's no real harm there. Wanted to have a menu using this (one of those nice superfish-style dropdown menus), but I suspect that that would REALLY kill the server (having to resolve this recursion on every single page call).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://blog.elsdoerfer.name/2008/01/22/recursion-in-django-templates/comment-page-1/#comment-939</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 25 Feb 2010 21:42:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elsdoerfer.info/2008/01/22/recursion-in-django-templates/#comment-939</guid>
		<description>I would now say it&#039;s mainly problematic since it relies on an implementation detail in the Django template language. There&#039;s no guarantee this might not stop working in a new version. 

As for performance issue, I was probably too alarmist, especially now that Django actually can cache templates in memory once compiled. So you probably shouldn&#039;t worry.

But still, if you do want to go after performance, and you are rendering out a forum thread with a huge number of branches and nodes, it&#039;ll sure be faster to set something like an indentation-level attribute in your python code.</description>
		<content:encoded><![CDATA[<p>I would now say it's mainly problematic since it relies on an implementation detail in the Django template language. There's no guarantee this might not stop working in a new version. </p>
<p>As for performance issue, I was probably too alarmist, especially now that Django actually can cache templates in memory once compiled. So you probably shouldn't worry.</p>
<p>But still, if you do want to go after performance, and you are rendering out a forum thread with a huge number of branches and nodes, it'll sure be faster to set something like an indentation-level attribute in your python code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rennat</title>
		<link>http://blog.elsdoerfer.name/2008/01/22/recursion-in-django-templates/comment-page-1/#comment-938</link>
		<dc:creator>rennat</dc:creator>
		<pubDate>Thu, 25 Feb 2010 19:20:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elsdoerfer.info/2008/01/22/recursion-in-django-templates/#comment-938</guid>
		<description>Ok so there&#039;s some cases where I really want to use this in production. (like dynamic nested nav) because it seems like an elegant solution from the way it&#039;s written.

Is this a really bad idea or just not a good idea for a million-uniques-a-day site?</description>
		<content:encoded><![CDATA[<p>Ok so there's some cases where I really want to use this in production. (like dynamic nested nav) because it seems like an elegant solution from the way it's written.</p>
<p>Is this a really bad idea or just not a good idea for a million-uniques-a-day site?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon</title>
		<link>http://blog.elsdoerfer.name/2008/01/22/recursion-in-django-templates/comment-page-1/#comment-579</link>
		<dc:creator>Brandon</dc:creator>
		<pubDate>Tue, 24 Mar 2009 04:17:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elsdoerfer.info/2008/01/22/recursion-in-django-templates/#comment-579</guid>
		<description>How do you actually implement this in the main template? I&#039;ve tried running this code as an include, and copy/pasted into my main template and handing it a set of categories:

  
	{% for category in categories %}  
		{{ category.name }}  
		{% with &quot;list.html&quot; as filename %}  
		{% with category.category_set.all as category %}  
			{% include filename %}
		{% endwith %}  
		{% endwith %}
	{% endfor %}  
	

This causes the built-in server to completely shut down without an error. What am I doing wrong?</description>
		<content:encoded><![CDATA[<p>How do you actually implement this in the main template? I've tried running this code as an include, and copy/pasted into my main template and handing it a set of categories:</p>
<p>	{% for category in categories %}<br />
		{{ category.name }}<br />
		{% with "list.html" as filename %}<br />
		{% with category.category_set.all as category %}<br />
			{% include filename %}<br />
		{% endwith %}<br />
		{% endwith %}<br />
	{% endfor %}  </p>
<p>This causes the built-in server to completely shut down without an error. What am I doing wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan</title>
		<link>http://blog.elsdoerfer.name/2008/01/22/recursion-in-django-templates/comment-page-1/#comment-414</link>
		<dc:creator>Ivan</dc:creator>
		<pubDate>Mon, 06 Oct 2008 20:56:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.elsdoerfer.info/2008/01/22/recursion-in-django-templates/#comment-414</guid>
		<description>Super cool man...
I was just wondering why recursion doesn&#039;t work... in a reply-to-a-reply rendering template of mine


Why not use in production?
What could poooooosibly ever go wrong with a recursive call :)</description>
		<content:encoded><![CDATA[<p>Super cool man...<br />
I was just wondering why recursion doesn't work... in a reply-to-a-reply rendering template of mine</p>
<p>Why not use in production?<br />
What could poooooosibly ever go wrong with a recursive call <img src='http://blog.elsdoerfer.name/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
