Re: Template Tag caveat

2008-06-18 Thread Eric
I wasn't really trying to point out a flaw in Django. I was trying to bring something to light would probably be overlook. I know that it never occurred to me that writing to self would cause issues. Which it normally wouldn't outside of a for loop. It's just one of those things that should b

Re: Template Tag caveat

2008-06-18 Thread bruno desthuilliers
On 18 juin, 00:14, Eric <[EMAIL PROTECTED]> wrote: > This isn't a bug but it's something that might need to be documented > to prevent folks from doing something that may hurt them later: > (snip) > > repr_node = ReprNode("obj") > > for i in range(10): > repr_node.render(context)

Re: Template Tag caveat

2008-06-17 Thread Eric
A quick follow up on this post. I forgot to explain how to avoid the problem. To avoid the problem is to treat self as read only. So to fix the ReprNode, you'd simply do the following: class ReprNode(template.Node): def __init__(self, obj_expression) # Let's name this m