[Bugfix] 修改创建label时报错的bug

pull/1007/head
ibuler 2018-01-31 18:48:07 +08:00
parent 97dd411ab8
commit 1c7212014b
1 changed files with 4 additions and 0 deletions

View File

@ -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)