On Dec 13, 2005, at 8:15 AM, [EMAIL PROTECTED] wrote:
{% recurse through get_reply_list as post starting with forum_post.get_root_post %}

Hey Matt --

This looks really good, and I'm personally +1 on adding this to Django's default tags. However, there are a few things that would need to be changed first:

* You'll need to update the tag to use the post-0.9 format for registering and writing custom template tags. See http:// code.djangoproject.com/wiki/ BackwardsIncompatibleChanges#Templatesystemchanges for the details.

* There's a number of places that you write to the context, but you aren't quite doing it in the right way. Take a look at how the {% for %} tag does it (django/core/template/defaulttags.py) -- you need to push() a new context at the start of rendering and pop() it afterwards. That way the stuff you add to the context doesn't stick around after the tag is rendered, and the tag's inner context won't trash predefined variables. Also, it's probably a good idea to make all the special context variables fields of a parent object. That is, use things like {{ forloop.counter }} instead of just {{ counter }}.

Besides that, I think this rocks; thanks!

Jacob

Reply via email to