Ticket #1461: regroup_real.patch

File regroup_real.patch, 1.2 KB (added by Russell Cloran <russell@…>, 19 years ago)

Whoops, forgot one of the changes I made in the previous patch.

  • 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)
     
    729730    if lastbits_reversed[1][::-1] != 'as':
    730731        raise TemplateSyntaxError, "next-to-last argument to 'regroup' tag must be 'as'"
    731732
    732     expression = parser.compile_filter('var.%s' % lastbits_reversed[2][::-1])
     733    expression = parser.compile_filter('%s' % lastbits_reversed[2][::-1])
    733734
    734735    var_name = lastbits_reversed[0][::-1]
    735736    return RegroupNode(target, expression, var_name)
Back to Top