[Mpuls-commits] r3011 - in base/trunk: . mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jun 15 19:14:27 CEST 2010


Author: bh
Date: 2010-06-15 19:14:26 +0200 (Tue, 15 Jun 2010)
New Revision: 3011

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/model/case.py
Log:
* mpulsweb/model/case.py (MpulsCase.copy): Implement copying of
cases.
Requires libformed revision 142:3d9f24af7ee8.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-06-15 14:47:45 UTC (rev 3010)
+++ base/trunk/ChangeLog	2010-06-15 17:14:26 UTC (rev 3011)
@@ -1,3 +1,9 @@
+2010-06-15  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/model/case.py (MpulsCase.copy): Implement copying of
+	cases.
+	Requires libformed revision 142:3d9f24af7ee8.
+
 2010-06-14  Bernhard Herzog  <bh at intevation.de>
 
 	* mpulsweb/lib/base.py (BaseController.__before__): Add config

Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2010-06-15 14:47:45 UTC (rev 3010)
+++ base/trunk/mpulsweb/model/case.py	2010-06-15 17:14:26 UTC (rev 3011)
@@ -860,9 +860,10 @@
         return self.editor
 
     def copy(self):
-        """Will copy the case and all its content in a new case. Returns the id
-        of the new case."""
-        return None 
+        """Copy the case and all its contents into a new case."""
+        factory = InstanceFactory(g.formedTree, PostgresDBInterface())
+        self._load_formed_instance_tree()
+        factory.copy_instance_tree(self.formed_instance)
 
     def delete(self):
         """Deletes the case from data base. Returns True if deletion succseeds



More information about the Mpuls-commits mailing list