Ticket #1461: regroup_real.patch
File regroup_real.patch, 1.2 KB (added by , 19 years ago) |
---|
-
django/template/defaulttags.py
192 192 return '' 193 193 output = [] # list of dictionaries in the format {'grouper': 'key', 'list': [list of contents]} 194 194 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})) 196 197 # TODO: Is this a sensible way to determine equality? 197 198 if output and repr(output[-1]['grouper']) == repr(grouper): 198 199 output[-1]['list'].append(obj) … … 729 730 if lastbits_reversed[1][::-1] != 'as': 730 731 raise TemplateSyntaxError, "next-to-last argument to 'regroup' tag must be 'as'" 731 732 732 expression = parser.compile_filter(' var.%s' % lastbits_reversed[2][::-1])733 expression = parser.compile_filter('%s' % lastbits_reversed[2][::-1]) 733 734 734 735 var_name = lastbits_reversed[0][::-1] 735 736 return RegroupNode(target, expression, var_name)