mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Include "parts" count in Category API
This commit is contained in:
parent
40822a93df
commit
7e8664a4dd
@ -18,6 +18,8 @@ class CategorySerializer(InvenTreeModelSerializer):
|
||||
|
||||
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
||||
|
||||
parts = serializers.IntegerField(source='item_count', read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = PartCategory
|
||||
fields = [
|
||||
@ -27,6 +29,7 @@ class CategorySerializer(InvenTreeModelSerializer):
|
||||
'pathstring',
|
||||
'url',
|
||||
'parent',
|
||||
'parts',
|
||||
]
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user