Ticket #2454: for-reset-ifchanged.diff
File for-reset-ifchanged.diff, 922 bytes (added by , 18 years ago) |
---|
-
django/template/defaulttags.py
100 100 for index in range(len(data)-1, -1, -1): 101 101 yield data[index] 102 102 values = reverse(values) 103 104 # reset the inner ifchanged-nodes 105 for node in self.nodelist_loop: 106 if type(node) == IfChangedNode: 107 node.reset() 108 103 109 for i, item in enumerate(values): 104 110 context['forloop'] = { 105 111 # shortcuts for current loop iteration number … … 137 143 else: 138 144 return '' 139 145 146 def reset(self): 147 self._last_seen = None 148 140 149 class IfEqualNode(Node): 141 150 def __init__(self, var1, var2, nodelist_true, nodelist_false, negate): 142 151 self.var1, self.var2 = var1, var2