feat: mlog count_fields 可不带count_ok_full
This commit is contained in:
parent
fa66a9a4d5
commit
5e3069b147
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue