[Mpuls-commits] r2571 - wasko/branches/2.0/mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Apr 30 10:12:11 CEST 2010


Author: torsten
Date: 2010-04-30 10:12:07 +0200 (Fri, 30 Apr 2010)
New Revision: 2571

Modified:
   wasko/branches/2.0/mpulsweb/model/phase.py
Log:
* mpulsweb/model/phase.py (PhasePart.getLinks): Show all required
	fields. Do not check anymore if the field is currently relevant



Modified: wasko/branches/2.0/mpulsweb/model/phase.py
===================================================================
--- wasko/branches/2.0/mpulsweb/model/phase.py	2010-04-29 14:57:33 UTC (rev 2570)
+++ wasko/branches/2.0/mpulsweb/model/phase.py	2010-04-30 08:12:07 UTC (rev 2571)
@@ -282,11 +282,7 @@
     def getLinks(self):
         out = []
         if len(self.fields) > 0:
-            # Only add fields if they are relevant for the phase
-            # E.g ignore fields which are not required because of false
-            # conditional
-            for field in [field for field in self.fields 
-                          if field.has_relevant_rules()]:
+            for field in [field for field in self.fields]:
                 out.append(field.get_link())
         if len(out) == 0:
             out.append(_('No required fields found'))
@@ -353,6 +349,8 @@
         for rule in rules:
             self.conditions.append(Condition(field, rule, it))
 
+        #log.debug('name: %s, conditions: %s' % (self.name, self.conditions))
+
     def get_link(self):
         out = []
         style = self.is_ok() and "ok" or "error"
@@ -398,7 +396,6 @@
     def evaluate(self):
         id = self.field.getIdentifier()
         context = RuleEvalContext(self.it, id)
-        if not self.is_relevant: return True
         for result, variables in self.rule.getExpr().evaluate_instances(context):
             if not result and id in variables:
                 return False



More information about the Mpuls-commits mailing list