[Mpuls-commits] r4519 - base/trunk/mpulsweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Jan 24 23:07:35 CET 2011
Author: torsten
Date: 2011-01-24 23:07:35 +0100 (Mon, 24 Jan 2011)
New Revision: 4519
Modified:
base/trunk/mpulsweb/lib/search.py
Log:
* mpulsweb/lib/search.py (Search.convert_form_parameters): Parse sort
options. Fix parsing of state and editor paramaters.
Modified: base/trunk/mpulsweb/lib/search.py
===================================================================
--- base/trunk/mpulsweb/lib/search.py 2011-01-24 21:47:37 UTC (rev 4518)
+++ base/trunk/mpulsweb/lib/search.py 2011-01-24 22:07:35 UTC (rev 4519)
@@ -188,6 +188,12 @@
"""
search_options = dict()
+ # Sorting
+ if options.get('sort_field'):
+ search_options["sort_field"] = options.get('sort_field')
+ if options.get('sort_order'):
+ search_options["sort_order"] = options.get('sort_order')
+
# Searchstring
if options.get('search_str'):
search_options["search_string"] = [options.get('search_str')]
@@ -198,7 +204,7 @@
# for backwards compatibility we always include -1, but only
# if the user actually wants to search based on the state,
# i.e. when at least one state value was given.
- search_options["state"] = [-1] + list(state)
+ search_options["state"] = [-1] + list(int(s) for s in state)
# Responsibilty
# shown cases where the user is editor, or standin or both
@@ -209,7 +215,7 @@
# Editor
# shown cases where the user is editor or all (-1)
- if options.get("editor") and options.get("editor") != -1:
+ if options.get("editor") and int(options.get("editor")) != -1:
search_options["editor"] = options.get("editor")
if extended:
More information about the Mpuls-commits
mailing list