[Formed-commits] r331 - in trunk: . formed/formed/plugins/export

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed May 6 15:25:10 CEST 2009


Author: teichmann
Date: 2009-05-06 15:25:09 +0200 (Wed, 06 May 2009)
New Revision: 331

Modified:
   trunk/ChangeLog
   trunk/formed/formed/plugins/export/rg_sql.py
Log:
Create only depending repeat groups if no uuid is given.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-04-30 15:56:38 UTC (rev 330)
+++ trunk/ChangeLog	2009-05-06 13:25:09 UTC (rev 331)
@@ -1,3 +1,9 @@
+2009-05-06	Sascha L. Teichmann <teichmann at intevation.de>
+
+	* formed/formed/plugins/export/rg_sql.py: Only create depending 
+	  repeat groups if no uuid is given. If a uuid is given then
+	  the creation is triggered by an xml import.
+
 2009-04-28	Sascha L. Teichmann <teichmann at intevation.de>
 
 	* formed/formed/plugins/export/new_sql.py: New SQL schema generator to

Modified: trunk/formed/formed/plugins/export/rg_sql.py
===================================================================
--- trunk/formed/formed/plugins/export/rg_sql.py	2009-04-30 15:56:38 UTC (rev 330)
+++ trunk/formed/formed/plugins/export/rg_sql.py	2009-05-06 13:25:09 UTC (rev 331)
@@ -196,10 +196,9 @@
         WHERE  id = rid;
     ELSE
         PERFORM set_uuid('${RELATION}', rid);
+        ${CREATE_CHILDREN}
     END IF;
 
-    ${CREATE_CHILDREN}
-
     RETURN rid;
 END;
 $$$$;
@@ -243,13 +242,12 @@
     IF nuuid IS NOT NULL THEN
         UPDATE master_tbl SET uuid_id = nuuid WHERE id = rid;
     ELSE
-        PERFORM set_uuid('master_tbl', mid);
+        PERFORM set_uuid('master_tbl', rid);
+        ${CREATE_CHILDREN}
     END IF;
 
     PERFORM create_status_ds(rid);
 
-    ${CREATE_CHILDREN}
-
     RETURN rid;
 END;
 $$$$;
@@ -299,7 +297,7 @@
             for child in self.children:
                 for i in range(child.min):
                     cout.append("PERFORM create_%s(rid, NULL);" % child.name);
-            create_children = "\n    ".join(cout);
+            create_children = "\n      ".join(cout);
         else:
             create_children = ""
 
@@ -413,7 +411,7 @@
             return
         elif isinstance(child, Node):
             if isinstance(child, data.RepeatNode):
-                self._createRepeatGroup(child)
+                self._createRepeatNode(child)
             else:
                 self._createRecursive(child)
 



More information about the Formed-commits mailing list