[Mpuls-commits] r3432 - in jmd/trunk: . jmdweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Aug 17 20:41:34 CEST 2010


Author: bh
Date: 2010-08-17 20:41:33 +0200 (Tue, 17 Aug 2010)
New Revision: 3432

Modified:
   jmd/trunk/ChangeLog
   jmd/trunk/jmdweb/lib/search.py
Log:
* jmdweb/lib/search.py (CaseSearch.VALID_OPTIONS): Add "gender" as
valid option
(CaseSearch.get_gender_clause): Implement gender search.


Modified: jmd/trunk/ChangeLog
===================================================================
--- jmd/trunk/ChangeLog	2010-08-17 18:39:54 UTC (rev 3431)
+++ jmd/trunk/ChangeLog	2010-08-17 18:41:33 UTC (rev 3432)
@@ -1,5 +1,11 @@
 2010-08-17  Bernhard Herzog  <bh at intevation.de>
 
+	* jmdweb/lib/search.py (CaseSearch.VALID_OPTIONS): Add "gender" as
+	valid option
+	(CaseSearch.get_gender_clause): Implement gender search.
+
+2010-08-17  Bernhard Herzog  <bh at intevation.de>
+
 	* jmdstrukturweb/lib/search.py: Remove unused imports.
 	(SEARCH_WHERE): Removed. No longer needed.
 

Modified: jmd/trunk/jmdweb/lib/search.py
===================================================================
--- jmd/trunk/jmdweb/lib/search.py	2010-08-17 18:39:54 UTC (rev 3431)
+++ jmd/trunk/jmdweb/lib/search.py	2010-08-17 18:41:33 UTC (rev 3432)
@@ -36,7 +36,16 @@
 
 class CaseSearch(CaseBaseSearch):
 
-    pass
+    VALID_OPTIONS = (CaseBaseSearch.VALID_OPTIONS
+                     + ("gender",))
 
 
+    def get_gender_clause(self, search, options):
+        gender = options.get("gender")
+        if gender is not None:
+            return "m.geschlecht = %s" % gender
+        return "TRUE"
+
+
+
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list