[Formed-commits] r302 - in trunk: . formed/formed/io formed/formed/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Jan 9 16:54:41 CET 2009
Author: torsten
Date: 2009-01-09 16:54:40 +0100 (Fri, 09 Jan 2009)
New Revision: 302
Modified:
trunk/ChangeLog
trunk/formed/formed/io/document.py
trunk/formed/formed/model/data.py
Log:
Added new repeat node
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-01-08 11:57:14 UTC (rev 301)
+++ trunk/ChangeLog 2009-01-09 15:54:40 UTC (rev 302)
@@ -1,3 +1,11 @@
+2009-01-09 Torsten Irländer <torsten.irlaender at intevation.de>
+
+ Added new repeat node
+
+ * formed/formed/model/data.py,
+ formed/formed/io/document.py: Added repeatnode to the formedtree.
+ TODO: Remove repeatgroup handling from the groupnode.
+
2009-01-08 Torsten Irländer <torsten.irlaender at intevation.de>
Add isset operator to autogenerated rules.
Modified: trunk/formed/formed/io/document.py
===================================================================
--- trunk/formed/formed/io/document.py 2009-01-08 11:57:14 UTC (rev 301)
+++ trunk/formed/formed/io/document.py 2009-01-09 15:54:40 UTC (rev 302)
@@ -34,6 +34,7 @@
DATE_TAG = u"date"
TEXT_AREA_TAG = u"textarea"
RULE_TAG = u"rule"
+REPEAT_TAG = u"repeat"
namesToClasses = {
DOCUMENT_TAG: RootNode,
@@ -49,6 +50,7 @@
TEXT_TAG: TextLeaf,
TEXT_AREA_TAG: TextAreaLeaf,
RULE_TAG: RuleLeaf,
+ REPEAT_TAG: RepeatNode,
DATE_TAG: DateLeaf}
factoryCreators = {
@@ -58,6 +60,7 @@
MATRIX_TAG: SimpleCreator(NodeFactory, MatrixNode),
RADIO_TAG: SimpleCreator(NodeFactory, RadioNode),
CHOICE_TAG: SimpleCreator(NodeFactory, ChoiceNode),
+ REPEAT_TAG: SimpleCreator(NodeFactory, RepeatNode),
EXT_CHOICE_LIST_TAG: SimpleCreator(NodeComponentFactory, ExternalChoiceListLeaf),
BOOL_TAG: SimpleCreator(NodeComponentFactory, BoolLeaf),
INT_TAG: SimpleCreator(NodeComponentFactory, IntLeaf),
@@ -74,6 +77,7 @@
MatrixNode: MATRIX_TAG,
RadioNode: RADIO_TAG,
ChoiceNode: CHOICE_TAG,
+ RepeatNode: REPEAT_TAG,
IntLeaf: INT_TAG,
InfoLeaf: INFO_TAG,
TextLeaf: TEXT_TAG,
Modified: trunk/formed/formed/model/data.py
===================================================================
--- trunk/formed/formed/model/data.py 2009-01-08 11:57:14 UTC (rev 301)
+++ trunk/formed/formed/model/data.py 2009-01-09 15:54:40 UTC (rev 302)
@@ -50,7 +50,18 @@
collector = WidgetCollector()
self.visit(collector.visitor, mode, allModes)
return collector.widgets
-
+
+class RepeatNode(Node):
+ def __init__(self):
+ Node.__init__(self)
+ self.attributes["min"] = ""
+ self.attributes["max"] = ""
+
+ def allWidgets(self, mode=None, allModes=None):
+ collector = WidgetCollector()
+ self.visit(collector.visitor, mode, allModes)
+ return collector.widgets
+
class GroupNode(Node):
def __init__(self):
Node.__init__(self)
More information about the Formed-commits
mailing list