[Mpuls-commits] r2851 - in wasko/branches/1.0/waskaweb: lib model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jun 2 10:28:44 CEST 2010


Author: torsten
Date: 2010-06-02 10:28:36 +0200 (Wed, 02 Jun 2010)
New Revision: 2851

Modified:
   wasko/branches/1.0/waskaweb/lib/search.py
   wasko/branches/1.0/waskaweb/model/case.py
Log:
Load tags in caseoverview


Modified: wasko/branches/1.0/waskaweb/lib/search.py
===================================================================
--- wasko/branches/1.0/waskaweb/lib/search.py	2010-06-01 14:51:35 UTC (rev 2850)
+++ wasko/branches/1.0/waskaweb/lib/search.py	2010-06-02 08:28:36 UTC (rev 2851)
@@ -54,7 +54,8 @@
       st.id as s_id,
       m.nbtr as zeitraum_nachbetreuung,
       m.cm_end_art as art_beendigung,
-      m.einwilligung as einverstaendniserklaerung
+      m.einwilligung as einverstaendniserklaerung,
+      ARRAY(SELECT tag_id from nm_tags_cases_view where case_id = m.id) as tags
     FROM master_tbl_view m
     JOIN ka_status_tbl_view st ON
     m.id = st.master_id

Modified: wasko/branches/1.0/waskaweb/model/case.py
===================================================================
--- wasko/branches/1.0/waskaweb/model/case.py	2010-06-01 14:51:35 UTC (rev 2850)
+++ wasko/branches/1.0/waskaweb/model/case.py	2010-06-02 08:28:36 UTC (rev 2851)
@@ -372,7 +372,8 @@
                 row['zugriff'], \
                 row['zeitraum_nachbetreuung'], \
                 row['art_beendigung'], \
-                row['phase'])
+                row['phase'],
+                row['tags'])
             self.ds_list.append(case)
         return self.ds_list
 
@@ -412,7 +413,7 @@
         case.tags          = result.get('tags')
         return case
 
-    def loadByName(self, id, first_name, last_name, knr, bearbeiter_id, einverst, s_id, s_state, s_access, s_cm_finished, s_cm_canceled, phase):
+    def loadByName(self, id, first_name, last_name, knr, bearbeiter_id, einverst, s_id, s_state, s_access, s_cm_finished, s_cm_canceled, phase, tags):
         '''This method does not actually loads a case from the database. It
         just returns a case object initiated with the provided parameters'''
         case = Case()
@@ -422,6 +423,7 @@
         case.knr        = unicode(str(knr),        'utf-8')
         case.editor     = bearbeiter_id
         case.state      = State()
+        case.tags       = tags
         case.state.setData(s_id, id, s_state, s_access, s_cm_finished, s_cm_canceled, phase)
         case.privacy_statement_signed = einverst in (1, -1) and True or False
         return case



More information about the Mpuls-commits mailing list