[Mpuls-commits] r5672 - wasko/trunk/waskoweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Nov 29 10:42:37 CET 2011


Author: ludwig
Date: 2011-11-29 10:42:37 +0100 (Tue, 29 Nov 2011)
New Revision: 5672

Modified:
   wasko/trunk/waskoweb/model/case.py
Log:
Meta Wasko: male/female number switch in getHashFields to handle the different
setting of gender number.
In wasko male is 0 and female 1. GetHashFields expects male to be 1 and
female to be 0.


Modified: wasko/trunk/waskoweb/model/case.py
===================================================================
--- wasko/trunk/waskoweb/model/case.py	2011-11-28 14:50:57 UTC (rev 5671)
+++ wasko/trunk/waskoweb/model/case.py	2011-11-29 09:42:37 UTC (rev 5672)
@@ -104,10 +104,20 @@
         fields = {}
         fields['firstname'] = self.get_value('vorname')
         fields['birthname'] = self.get_value('name')
-        fields['gender'] = self.get_value('geschlecht')
+        fields['gender'] = self.switch_gender_field(
+                                       self.get_value('geschlecht'))
         fields['birthdate'] = self.get_value('geburtsdatum')
         return fields
 
+    def switch_gender_field(self, gender):
+        """switch_gender_field switches male/female number, because in Wasko
+        these numbers are different as in base"""
+        if gender == 0:
+            return 1
+        elif gender == 1:
+            return 0
+        return gender
+
     #def setEditor(self, userid):
     #    """Sets the name of the editor in formular of the case.  First call
     #    setEditor function in baseclass to transfer the case to the new user.



More information about the Mpuls-commits mailing list