[Mpuls-commits] r670 - in waska/trunk: . formed waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Nov 2 15:45:04 CET 2009


Author: torsten
Date: 2009-11-02 15:45:03 +0100 (Mon, 02 Nov 2009)
New Revision: 670

Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/formed/formedtree_web.xml
   waska/trunk/waskaweb/model/semantic.py
Log:
Adopted semantic checks on grouping


Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2009-11-02 14:13:14 UTC (rev 669)
+++ waska/trunk/ChangeLog.txt	2009-11-02 14:45:03 UTC (rev 670)
@@ -8,6 +8,14 @@
 
 	* renderer.py: Render groups in choicelists
 
+	Implement sorting of choicelists
+
+	* waskaweb/model/nodecomponents.py,
+	  waskaweb/model/data.py,
+	  waskaweb/model/io/document.py,
+	  waskaweb/model/semantic.py: Choicelists can now be sorted based on the
+	  target attribute
+
 2009-09-30 	Torsten Irlaender  <torsten.irlaender at intevation.de>
 
 	Issue844

Modified: waska/trunk/formed/formedtree_web.xml
===================================================================
--- waska/trunk/formed/formedtree_web.xml	2009-11-02 14:13:14 UTC (rev 669)
+++ waska/trunk/formed/formedtree_web.xml	2009-11-02 14:45:03 UTC (rev 670)
@@ -64,7 +64,7 @@
             <bool description="andere Schule (z.B. Berufsfachschule)" name="inandereschule" value="7"/>
           </group>
           <group description="Ausbildung" name="group-8">
-            <bool description="duale Berufsausbildung (auch Verbundausbildung)" name="inderausbildung" value="1"/>
+            <bool description="duale Berufsausbildung (auch Verbundausbildung)" name="inderausbildung" value="1" target="3"/>
             <bool description="schulische Berufsausbildung" name="schulischeausbildung" value="8"/>
             <bool description="geförderte Berufsausbildung (BaE)" name="gefoerderteausbildung" value="9"/>
           </group>

Modified: waska/trunk/waskaweb/model/semantic.py
===================================================================
--- waska/trunk/waskaweb/model/semantic.py	2009-11-02 14:13:14 UTC (rev 669)
+++ waska/trunk/waskaweb/model/semantic.py	2009-11-02 14:45:03 UTC (rev 670)
@@ -178,6 +178,17 @@
                                     return int(v)
                                 except ValueError:
                                     return v
+            elif isinstance(c, waskaweb.model.data.GroupNode):
+                cc = c.children
+                if cc:
+                    for i in cc:
+                        if isinstance(i, waskaweb.model.data.BoolLeaf):
+                            v = i.getValue()
+                            if v == value:
+                                try:
+                                    return int(v)
+                                except ValueError:
+                                    return v
 
         raise SematicError("'%s' is not a valid value for '%s'" % (
             value, nc.getName()))



More information about the Mpuls-commits mailing list