2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 04:26:44 +00:00

Add function to get the number of required tests for a part

This commit is contained in:
Oliver Walters 2020-05-23 14:28:25 +10:00
parent e63342418f
commit 01481ef5c9

View File

@ -1033,6 +1033,9 @@ class Part(MPTTModel):
# Return the tests which are required by this part # Return the tests which are required by this part
return self.getTestTemplates(required=True) return self.getTestTemplates(required=True)
def requiredTestCount(self):
return self.getRequiredTests().count()
@property @property
def attachment_count(self): def attachment_count(self):
""" Count the number of attachments for this part. """ Count the number of attachments for this part.