2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 04:25:42 +00:00

Add "level" to PartCategory serializer

- Also use tree ordering by default
This commit is contained in:
Oliver Walters
2021-07-18 21:11:53 +10:00
parent 5ce6dd325d
commit 36cf614aed
3 changed files with 17 additions and 8 deletions

View File

@ -32,6 +32,8 @@ class CategorySerializer(InvenTreeModelSerializer):
parts = serializers.IntegerField(source='item_count', read_only=True)
level = serializers.IntegerField(read_only=True)
class Meta:
model = PartCategory
fields = [
@ -40,10 +42,11 @@ class CategorySerializer(InvenTreeModelSerializer):
'description',
'default_location',
'default_keywords',
'pathstring',
'url',
'level',
'parent',
'parts',
'pathstring',
'url',
]