Browse files

explanation for a strange monkey patch in django2jinja (thanks djc)

branch : trunk
  • Loading branch information...
1 parent 671e06b commit db19b3045e1475766a78b0c9762a4f11e34d1bbf @mitsuhiko mitsuhiko committed Jul 7, 2009
Showing with 4 additions and 1 deletion.
  1. +4 −1 ext/django2jinja/
@@ -86,7 +86,10 @@ def write_my_node(writer, node):
_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)

0 comments on commit db19b30

Please sign in to comment.