jan: thuban/Thuban/Model load.py,1.56,1.57

cvs@intevation.de cvs at intevation.de
Wed Jul 27 23:50:32 CEST 2005


Author: jan

Update of /thubanrepository/thuban/Thuban/Model
In directory doto:/tmp/cvs-serv6668

Modified Files:
	load.py 
Log Message:
(SessionLoader.start_classification): Change attribute 'field' and
'field_type' from obligatory to optional to allow empty classes
(ie.  only with a default=clnull).


Index: load.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/Model/load.py,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- load.py	1 Jul 2005 20:49:04 -0000	1.56
+++ load.py	27 Jul 2005 21:50:30 -0000	1.57
@@ -525,11 +525,16 @@
         self.aLayer = None
 
     def start_classification(self, name, qname, attrs):
+    	# field and field_type are optional because the classification
+	# can also be empty, ie. have only a default.
         attrs = self.check_attrs(name, attrs,
-                                 [AttrDesc("field", True),
-                                  AttrDesc("field_type", True)])
+                                 [AttrDesc("field", False),
+                                  AttrDesc("field_type", False)])
+
         field = attrs["field"]
         fieldType = attrs["field_type"]
+
+	if field == "": return # no need to set classification column.
 
         dbFieldType = self.aLayer.GetFieldType(field)
 





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)