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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Oct 22 19:13:48 CEST 2010


Author: bh
Date: 2010-10-22 19:13:47 +0200 (Fri, 22 Oct 2010)
New Revision: 4017

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/model/logbook.py
Log:
* mpulsweb/model/logbook.py (LOAD_LOGBOOK, LOAD_LOGBOOK_BY_ID):
Fetch the uuid of the entry as well.
(LogbookEntry.__init__, LogbookEntry.setByRow): Set uuid instance
variable too.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-10-22 16:10:02 UTC (rev 4016)
+++ base/trunk/ChangeLog	2010-10-22 17:13:47 UTC (rev 4017)
@@ -1,5 +1,15 @@
 2010-10-22  Bernhard Herzog  <bh at intevation.de>
 
+	Fetch UUIDs of logbook entries, in preparation for logbook XML
+	export
+
+	* mpulsweb/model/logbook.py (LOAD_LOGBOOK, LOAD_LOGBOOK_BY_ID):
+	Fetch the uuid of the entry as well.
+	(LogbookEntry.__init__, LogbookEntry.setByRow): Set uuid instance
+	variable too.
+
+2010-10-22  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/model/case.py (MPulsXMLImporter.import_case): New.
 	Override this method instead of import_allowed as it's now the
 	method sub-classes need to override to influence imports.

Modified: base/trunk/mpulsweb/model/logbook.py
===================================================================
--- base/trunk/mpulsweb/model/logbook.py	2010-10-22 16:10:02 UTC (rev 4016)
+++ base/trunk/mpulsweb/model/logbook.py	2010-10-22 17:13:47 UTC (rev 4017)
@@ -41,13 +41,15 @@
 
 ALLOWED_SORTING = ['name', 'art', 'dauer', 'datum', 'asc', 'desc', 'bearbeiter']
 LOAD_LOGBOOK = """
-SELECT l.id AS id, datum, bearbeiter, art, kurz_notiz, notiz, dauer, typ
+SELECT l.id AS id, datum, bearbeiter, art, kurz_notiz, notiz, dauer, typ,
+       uuid_id
 FROM ka_logbuch_tbl_view l WHERE l.master_id = %s
 ORDER BY %s %s
 """
 
 LOAD_LOGBOOK_BY_ID = """
-SELECT l.id AS id, datum, bearbeiter, art, kurz_notiz, notiz, dauer, typ
+SELECT l.id AS id, datum, bearbeiter, art, kurz_notiz, notiz, dauer, typ,
+       uuid_id
 FROM ka_logbuch_tbl_view l WHERE l.id = %(mid)s
 """
 
@@ -102,6 +104,7 @@
         self.notiz = None
         self.dauer = None
         self.typ = None
+        self.uuid = None
 
     def setByRow(self, row):
         self.id = row[0]
@@ -112,6 +115,7 @@
         self.notiz = row[5] and h.ensure_unicode(row[5]) or None
         self.dauer = row[6]
         self.typ = row[7]
+        self.uuid = row[8]
 
     def loadById(self, id):
         self.id = id



More information about the Mpuls-commits mailing list