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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Oct 1 15:03:17 CEST 2010


Author: torsten
Date: 2010-10-01 15:03:12 +0200 (Fri, 01 Oct 2010)
New Revision: 3844

Modified:
   base/trunk/mpulsweb/model/phase.py
Log:
* mpulsweb/model/phase.py (Field.get_link): New function get_url. To
	get the url for a field an a forumular page
* mpulsweb/model/phase.py (Field.get_link): Use new function get_url


Modified: base/trunk/mpulsweb/model/phase.py
===================================================================
--- base/trunk/mpulsweb/model/phase.py	2010-10-01 10:15:32 UTC (rev 3843)
+++ base/trunk/mpulsweb/model/phase.py	2010-10-01 13:03:12 UTC (rev 3844)
@@ -407,15 +407,17 @@
         for rule in rules:
             self.conditions.append(Condition(field, rule, it))
 
+    def get_url(self):
+        element_id = ":".join(self.id.split(':')[1:])
+        return  url_for(controller='/formularpage', action='select',
+                        id=('%s:%s' % (self.page, element_id)),
+                        anchor=('%s:%s' % (self.name,
+                        element_id)))
     def get_link(self):
         out = []
         style = self.is_ok() and "ok" or "error"
-        element_id = ":".join(self.id.split(':')[1:])
         out.append(tag("a", class_=style,
-                       href=url_for(controller='/formularpage', action='select',
-                                    id=('%s:%s' % (self.page, element_id)),
-                                    anchor=('%s:%s' % (self.name,
-                                                       element_id)))))
+                       href=self.get_url()))
         out.append('%s' % self.label)
         out.append('</a>')
         return "".join(out)



More information about the Mpuls-commits mailing list