diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2008-06-26 04:30:06 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2008-06-26 04:30:06 +0000 |
| commit | dbde7fc8b0932a169b8319dc597433aef1cb9520 (patch) | |
| tree | 1e01a29b4a8a4e6a2244fadee590e1961492eada /django | |
| parent | 65437a95e146a90d74686eb4414f1a210cbac0fe (diff) | |
Fixed #6322 -- Fixed bug in 'ifchanged' template tag where it wasn't resetting itself properly in some cases. Thanks, nedbatchelder
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7752 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/template/defaulttags.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index cf3b35b4cc..2d887d022e 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -162,10 +162,12 @@ class IfChangedNode(Node): self.nodelist = nodelist self._last_seen = None self._varlist = map(Variable, varlist) + self._id = str(id(self)) def render(self, context): - if 'forloop' in context and context['forloop']['first']: + if 'forloop' in context and self._id not in context['forloop']: self._last_seen = None + context['forloop'][self._id] = 1 try: if self._varlist: # Consider multiple parameters. This automatically behaves |
