2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 10:05:39 +00:00

Changed some category views to use boostrap list-group

- Looks much fancier!
This commit is contained in:
Oliver
2018-04-14 23:05:36 +10:00
parent 0e2c5e6af5
commit 204874dcb4
6 changed files with 220 additions and 24 deletions

View File

@ -20,6 +20,20 @@ class PartCategory(InvenTreeTree):
verbose_name = "Part Category"
verbose_name_plural = "Part Categories"
@property
def partcount(self):
""" Return the total part count under this category
(including children of child categories)
"""
count = self.parts.count()
for child in self.children.all():
count += child.partcount
return count
"""
@property
def parts(self):