From db19b3045e1475766a78b0c9762a4f11e34d1bbf Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 7 Jul 2009 13:22:34 +0200 Subject: [PATCH] explanation for a strange monkey patch in django2jinja (thanks djc) --HG-- branch : trunk --- ext/django2jinja/django2jinja.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/django2jinja/django2jinja.py b/ext/django2jinja/django2jinja.py index 9dae009..6d9e76c 100644 --- a/ext/django2jinja/django2jinja.py +++ b/ext/django2jinja/django2jinja.py @@ -86,7 +86,10 @@ _resolved_filters = {} _newline_re = re.compile(r'(?:\r\n|\r|\n)') -# don't ask.... +# Django stores an itertools object on the cycle node. Not only is this +# thread unsafe but also a problem for the converter which needs the raw +# string values passed to the constructor to create a jinja loop.cycle() +# call from it. _old_cycle_init = core_tags.CycleNode.__init__ def _fixed_cycle_init(self, cyclevars, variable_name=None): self.raw_cycle_vars = map(Variable, cyclevars) -- 2.26.2