Ticket #1461: regroup.patch

File regroup.patch, 782 bytes (added by Russell Cloran <russell@…>, 19 years ago)
  • django/template/defaulttags.py

     
    192192            return ''
    193193        output = [] # list of dictionaries in the format {'grouper': 'key', 'list': [list of contents]}
    194194        for obj in obj_list:
    195             grouper = self.expression.resolve(Context({'var': obj}))
     195            grouper = self.expression.resolve(context)
     196            grouper = resolve_variable('var.%s' % grouper, Context({'var': obj}))
    196197            # TODO: Is this a sensible way to determine equality?
    197198            if output and repr(output[-1]['grouper']) == repr(grouper):
    198199                output[-1]['list'].append(obj)
Back to Top