diff --git a/apps/assets/models/label.py b/apps/assets/models/label.py index 990a71ca8..10038d5d4 100644 --- a/apps/assets/models/label.py +++ b/apps/assets/models/label.py @@ -29,6 +29,10 @@ class Label(models.Model): for name in names: yield name, cls.objects.filter(name=name) + @property + def asset_count(self): + return self.assets.count() + def __str__(self): return "{}:{}".format(self.name, self.value)