[Mpuls-commits] r137 - in waska/trunk: . waskaweb/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Sep 8 10:38:25 CEST 2008
Author: teichmann
Date: 2008-09-08 10:38:25 +0200 (Mon, 08 Sep 2008)
New Revision: 137
Modified:
waska/trunk/ChangeLog.txt
waska/trunk/waskaweb/model/phases_factory.py
Log:
Added a method to generate SQL to check for phase inconsistencies
at databse level.
Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt 2008-09-04 16:32:16 UTC (rev 136)
+++ waska/trunk/ChangeLog.txt 2008-09-08 08:38:25 UTC (rev 137)
@@ -1,3 +1,9 @@
+2008-09-08 Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
+ * waskaweb/model/phases_factory.py: added a method getSQLWhereClauses() to return
+ a list of tuples (<symbol of phase>, <sql where clause>) to check phase inconsistencies
+ at database level.
+
2008-09-04 Sascha L. Teichmann <sascha.teichmann at intevation.de>
* waskaweb/model/phases.py, waskaweb/model/phases_factory.py: Fixed
Modified: waska/trunk/waskaweb/model/phases_factory.py
===================================================================
--- waska/trunk/waskaweb/model/phases_factory.py 2008-09-04 16:32:16 UTC (rev 136)
+++ waska/trunk/waskaweb/model/phases_factory.py 2008-09-08 08:38:25 UTC (rev 137)
@@ -140,6 +140,15 @@
def loadFromDatabase(self, ds_id, cur):
return self.loadFilled(ds_id, cur) and self.loadTimes(ds_id, cur) and True or False
+
+ def getSQLWhereClauses(self):
+ """ returns list of tuples (<symbol of phase>, <sql where clause>) """
+ clauses = []
+ for k, v in self.phases.iteritems():
+ where = " OR ".join([IS_FILLED % { 'name': name } for name in [i[0].getName() for i in v]])
+ clauses.append((k, where))
+ return clauses
+
def loadFilled(self, ds_id, cur):
fields = {}
idx = 0
More information about the Mpuls-commits
mailing list