[Mpuls-commits] r5859 - base/trunk/mpulsweb/model

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Tue Mar 6 13:44:58 CET 2012


Author: ludwig
Date: 2012-03-06 13:44:58 +0100 (Tue, 06 Mar 2012)
New Revision: 5859

Modified:
   base/trunk/mpulsweb/model/document.py
Log:
Issue 2682: Enable document datum for export xml and import xml.


Modified: base/trunk/mpulsweb/model/document.py
===================================================================
--- base/trunk/mpulsweb/model/document.py	2012-03-06 11:20:11 UTC (rev 5858)
+++ base/trunk/mpulsweb/model/document.py	2012-03-06 12:44:58 UTC (rev 5859)
@@ -378,6 +378,8 @@
                         base64.b64encode(document.data))
         text_subelement(document_element, "anlage-beschreibung",
                         document.description)
+        text_subelement(document_element, "anlage-datum",
+                        document.insert_date)  
 
 def get_documents_import_factory():
     """Return component factory for documents for libformed xmlimport"""
@@ -386,6 +388,7 @@
                                 new_node(TextLeaf, "anlage-name"),
                                 new_node(TextLeaf, "anlage-daten"),
                                 new_node(TextLeaf, "anlage-beschreibung"),
+                                new_node(TextLeaf, "anlage-datum")
                                 ],
                                [])
     return ComponentFactory(None,
@@ -414,8 +417,9 @@
     mime = document.get_leaf("anlage-mime")
     content = base64.b64decode(document.get_leaf("anlage-daten"))
     description = document.get_leaf("anlage-beschreibung")
+    insert_date = document.get_leaf("anlage-datum")
     create_document_with_cursor(cursor, name, content, mime, case_id, None,
-                                description)
+                                description, insert_date=insert_date)
 
 
 def load_known_documents(cursor, case_id):



More information about the Mpuls-commits mailing list