feat: add assets amount field to platform page

This commit is contained in:
wangruidong
2024-07-24 18:23:12 +08:00
committed by w940853815
parent 88037b2038
commit 2e625f2c33
3 changed files with 23 additions and 7 deletions

View File

@@ -111,6 +111,10 @@ class Platform(LabeledMixin, JMSBaseModel):
def type_constraints(self):
return AllTypes.get_constraints(self.category, self.type)
@lazyproperty
def assets_amount(self):
return self.assets.count()
@classmethod
def default(cls):
linux, created = cls.objects.get_or_create(