[Mpuls-commits] r3274 - base/trunk/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jul 29 16:54:38 CEST 2010


Author: torsten
Date: 2010-07-29 16:54:38 +0200 (Thu, 29 Jul 2010)
New Revision: 3274

Modified:
   base/trunk/mpulsweb/controllers/case_overview.py
Log:
* mpulsweb/controllers/case_overview.py (get_sort): User configured
default sort and order if user does not choose another sorting.


Modified: base/trunk/mpulsweb/controllers/case_overview.py
===================================================================
--- base/trunk/mpulsweb/controllers/case_overview.py	2010-07-29 14:53:23 UTC (rev 3273)
+++ base/trunk/mpulsweb/controllers/case_overview.py	2010-07-29 14:54:38 UTC (rev 3274)
@@ -18,11 +18,13 @@
 
 FORM_DEFAULTS_ADMIN = g.mpuls_config.get('search', 'admin_defaults')[0]
 FORM_DEFAULTS_CM = g.mpuls_config.get('search', 'cm_defaults')[0]
+FORM_DEFAULTS_SORT = g.mpuls_config.get('search', 'default-sorting')
+FORM_DEFAULTS_ORDER = g.mpuls_config.get('search', 'default-order')
 
 
 def get_sort(params):
-    sort = params.get('sort_field', 'id')
-    order = params.get('sort_order', 'asc')
+    sort = params.get('sort_field', FORM_DEFAULTS_SORT)
+    order = params.get('sort_order', FORM_DEFAULTS_ORDER)
     return sort, order
 
 def default_phases():



More information about the Mpuls-commits mailing list