fix: cache_key mpoint保留

This commit is contained in:
caoqianming 2024-05-06 00:10:47 +08:00
parent 6cd255173f
commit 6ae849150f
2 changed files with 4 additions and 2 deletions

View File

@ -43,7 +43,9 @@ class Mpoint(CommonBModel):
need_display = models.BooleanField("是否需要展示", default=False)
report_sortstr = models.CharField('在报告中的排序', max_length=50, default='', blank=True)
@classmethod
def cache_key(cls, code: str):
return f"mpoint_{code}"
class MpLogx(models.Model):
"""
测点记录超表

View File

@ -119,7 +119,7 @@ class MpointCache:
"""
def __init__(self, code: str):
self.code = code
self.cache_key = f'mpoint_{code}'
self.cache_key = Mpoint.cache_key(code)
self.data = self.get()
def get(self, force_update=False, update_mplogx=True):