aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/apps/indicator/models.py
diff options
context:
space:
mode:
Diffstat (limited to '97suifangqa/apps/indicator/models.py')
-rw-r--r--97suifangqa/apps/indicator/models.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/97suifangqa/apps/indicator/models.py b/97suifangqa/apps/indicator/models.py
index 0a3c8a5..b992a1f 100644
--- a/97suifangqa/apps/indicator/models.py
+++ b/97suifangqa/apps/indicator/models.py
@@ -396,15 +396,16 @@ class IndicatorRecord(models.Model): # {{{
NOTE: convert record data to 'standard unit' before comparison
"""
sind = self.indicator
- # unit relation
- unit_rel = self.unit.relation
- v = sympy.symbols('v')
- rel_sym = sympy.sympify(unit_rel)
- # error message
- errmsg = u"'%s' 求值错误,请检查只含有变量 'v'" % unit_rel
# check
if sind.dataType in [sind.FLOAT_TYPE, sind.RANGE_TYPE,
sind.FLOAT_RANGE_TYPE]:
+ # unit relation
+ unit_rel = self.unit.relation
+ v = sympy.symbols('v')
+ rel_sym = sympy.sympify(unit_rel)
+ # error message
+ errmsg = u"'%s' 求值错误,请检查只含有变量 'v'" % unit_rel
+ # check InnateConfine for the Indicator first
if not sind.check_confine():
return False
# InnateConfine is ok