From 89606ccdcdf2922bb40b49565db8fd8751c6eefc Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 10 Jul 2007 19:49:35 +0200 Subject: [PATCH] [svn] groupby sorts on it's own now --HG-- branch : trunk --- jinja/filters.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jinja/filters.py b/jinja/filters.py index f253d37..6e74164 100644 --- a/jinja/filters.py +++ b/jinja/filters.py @@ -877,10 +877,12 @@ def do_groupby(attribute): """ def wrapped(env, context, value): expr = lambda x: env.get_attribute(x, attribute) - return [{ + rv = [{ 'grouper': a, 'list': list(b) } for a, b in groupby(sorted(value, key=expr), expr)] + rv.sort() + return rv return wrapped -- 2.26.2