fix: translate_eval_formula enm_lhxs的处理
This commit is contained in:
parent
ce38c3e338
commit
52fc0c6bd3
|
@ -24,7 +24,7 @@ def translate_eval_formula(exp_str: str, year: int, month: int, day: int, hour:
|
||||||
matches = re.findall(pattern, exp_str)
|
matches = re.findall(pattern, exp_str)
|
||||||
for match in matches:
|
for match in matches:
|
||||||
if match in ['enm_lhxs']:
|
if match in ['enm_lhxs']:
|
||||||
exp_str = exp_str.replace(f"{{{match}}}", get_sysconfig(f'enm.{match}'))
|
exp_str = exp_str.replace(f"{{{match}}}", str(get_sysconfig(f'enm.{match}')))
|
||||||
else:
|
else:
|
||||||
mpst = MpointStat.objects.filter(Q(mpoint__id=match) | Q(mpoint__name=match) | Q(mpoint__code=match), type="hour", year=year, month=month, day=day, hour=hour).first()
|
mpst = MpointStat.objects.filter(Q(mpoint__id=match) | Q(mpoint__name=match) | Q(mpoint__code=match), type="hour", year=year, month=month, day=day, hour=hour).first()
|
||||||
if mpst:
|
if mpst:
|
||||||
|
|
Loading…
Reference in New Issue