Ticket #2454: for-reset-ifchanged.2.diff

File for-reset-ifchanged.2.diff, 559 bytes (added by dummy@…, 9 years ago)

Solution which handles all in ifchanged-implementation

  • django/template/defaulttags.py

     
    125125        self._last_seen = None
    126126
    127127    def render(self, context):
     128        if context.has_key('forloop') :
     129            if context['forloop']['first']:
     130                self._last_seen = None
    128131        content = self.nodelist.render(context)
    129132        if content != self._last_seen:
    130133            firstloop = (self._last_seen == None)
Back to Top