[Mpuls-commits] r2803 - waska/branches/1.7/waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri May 28 15:41:49 CEST 2010


Author: torsten
Date: 2010-05-28 15:41:48 +0200 (Fri, 28 May 2010)
New Revision: 2803

Modified:
   waska/branches/1.7/waskaweb/model/case.py
Log:
Load tags when loading a singe case or load ing the digest


Modified: waska/branches/1.7/waskaweb/model/case.py
===================================================================
--- waska/branches/1.7/waskaweb/model/case.py	2010-05-28 13:40:13 UTC (rev 2802)
+++ waska/branches/1.7/waskaweb/model/case.py	2010-05-28 13:41:48 UTC (rev 2803)
@@ -115,11 +115,12 @@
     mobiltelefon_1, 
     email_1,
     art_beendigung,
-    vermittlung
+    vermittlung,
+    ARRAY(SELECT tag_id from nm_tags_cases_view where case_id = %(id)s) as tags
 FROM master_tbl_view WHERE id = %(id)s
 """
 
-LOAD_CASE_SQL = """SELECT name_1, vorname_1, bearbeiter_id, kundennummer, erstgespraech, beendigung_5, art_beendigung, phase, zugang_kompetenzagentur, letzte_jahr_allg_schule, prognose_liegt_vor from master_tbl_view WHERE id = %(id)s"""
+LOAD_CASE_SQL = """SELECT name_1, vorname_1, bearbeiter_id, kundennummer, erstgespraech, beendigung_5, art_beendigung, phase, zugang_kompetenzagentur, letzte_jahr_allg_schule, prognose_liegt_vor, ARRAY(SELECT tag_id from nm_tags_cases_view where case_id = %(id)s) as tags from master_tbl_view WHERE id = %(id)s"""
 DELETE_CASE_SQL = """select delete_master_ds(%(id)s)""" 
 
 CREATE_CASE_SQL = """SELECT create_master_ds(%(uuid)s)"""
@@ -404,6 +405,7 @@
         case.first_meeting = result.get('erstgespraech')
         case.cm_end        = result.get('beendigung_5')
         case.editor        = result.get('bearbeiter_id', None)
+        case.tags          = result.get('tags')
         case.state         = State(id)
 
         # Hack. These values are used to determine if the phase of CM can be startet
@@ -719,6 +721,7 @@
             self.email             = unicode(str(result.get('email', '')), 'utf-8')
             self.age               = result.get('alter') and "%.0f" % result.get('alter') or "0"
             self.statement         = (result.get('einverstaendniserklaerung') >= 0)
+            self.tags              = result.get('tags')
 
             # Parents of the kids
             self.parent_first_name  = unicode(str(result.get('vorname_2', '')), 'utf-8')



More information about the Mpuls-commits mailing list