projects
/
jinja2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
56e20cf
)
[svn] groupby sorts on it's own now
author
Armin Ronacher
<armin.ronacher@active-4.com>
Tue, 10 Jul 2007 17:49:35 +0000
(19:49 +0200)
committer
Armin Ronacher
<armin.ronacher@active-4.com>
Tue, 10 Jul 2007 17:49:35 +0000
(19:49 +0200)
--HG--
branch : trunk
jinja/filters.py
patch
|
blob
|
history
diff --git
a/jinja/filters.py
b/jinja/filters.py
index f253d37e2a0913c94374a8385bf224a20860d3d1..6e741645e764d114f8068e96c715829942dbf7e4 100644
(file)
--- 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)
- r
eturn
[{
+ r
v =
[{
'grouper': a,
'list': list(b)
} for a, b in groupby(sorted(value, key=expr), expr)]
+ rv.sort()
+ return rv
return wrapped