From 5e3069b1470ced07bf7f5fa6a95b0afa578ad9e6 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 20 Mar 2025 09:51:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mlog=20count=5Ffields=20=E5=8F=AF?= =?UTF-8?q?=E4=B8=8D=E5=B8=A6count=5Fok=5Ffull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/qm/models.py | 4 +++- apps/wpm/models.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/qm/models.py b/apps/qm/models.py index f832e4e9..2cad5ec9 100644 --- a/apps/qm/models.py +++ b/apps/qm/models.py @@ -274,11 +274,13 @@ class FtestWork(CommonBDModel): qct = models.ForeignKey(Qct, verbose_name='关联质检表', on_delete=models.SET_NULL, null=True, blank=True) @classmethod - def count_fields(cls): + def count_fields(cls, without_count_ok_full=True): ftestwork_count_fields = [] for f in FtestWork._meta.fields: if f.name.startswith("count"): ftestwork_count_fields.append(f.name) + if without_count_ok_full: + ftestwork_count_fields.remove('count_ok_full') return ftestwork_count_fields def cal_count(self): diff --git a/apps/wpm/models.py b/apps/wpm/models.py index 478e4673..2a99738b 100644 --- a/apps/wpm/models.py +++ b/apps/wpm/models.py @@ -301,12 +301,14 @@ class Mlog(CommonADModel): return MlogbDefect.objects.filter(mlogb__mlog=self, mlogb__material_in__isnull=False) @classmethod - def count_fields(cls): + def count_fields(cls, without_count_ok_full=True): mlog_count_fields = [] for f in Mlog._meta.fields: if f.name.startswith("count"): mlog_count_fields.append(f.name) mlog_count_fields.remove("count_real_eweight") + if without_count_ok_full: + mlog_count_fields.remove("count_ok_full") return mlog_count_fields class Mlogb(BaseModel):