Author: floguy
Date: Mon Sep 22 02:40:20 2008
New Revision: 36
Modified:
trunk/things/options.py
Log:
Added request to the arguments for the custom aggregate support.
Modified: trunk/things/options.py
==============================================================================
--- trunk/things/options.py (original)
+++ trunk/things/options.py Mon Sep 22 02:40:20 2008
@@ -61,11 +61,11 @@
if field.custom_aggregate_function is not None:
caf = field.custom_aggregate_function
vgetter = lambda val: val[1]
- items = [i[0] for i in sorted([(j, caf(j)) for j in items],
+ items = [i[0] for i in sorted([(j, caf(request, j)) for j
in items],
key=vgetter, reverse=reverse)]
elif field.custom_aggregate_dict_function is not None:
cadf = field.custom_aggregate_dict_function
- pk_sort_dict = field.custom_aggregate_dict_function()
+ pk_sort_dict =
field.custom_aggregate_dict_function(request)
items = list(items.filter(pk__in=pk_sort_dict.keys()))
items.sort(key=lambda val: pk_sort_dict[val.id],
reverse=reverse)
elif isinstance(field, AggregateBase):
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---