[svn] groupby sorts on it's own now
authorArmin Ronacher <armin.ronacher@active-4.com>
Tue, 10 Jul 2007 17:49:35 +0000 (19:49 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Tue, 10 Jul 2007 17:49:35 +0000 (19:49 +0200)
--HG--
branch : trunk

jinja/filters.py

index f253d37e2a0913c94374a8385bf224a20860d3d1..6e741645e764d114f8068e96c715829942dbf7e4 100644 (file)
@@ -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