mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 01:55:39 +00:00
Updated Part API
- categories can now be filtered by parent - Added FilterChildren func to invenTree.models
This commit is contained in:
@ -43,21 +43,13 @@ class PartCategoryBriefSerializer(serializers.ModelSerializer):
|
||||
|
||||
class PartCategoryDetailSerializer(serializers.ModelSerializer):
|
||||
|
||||
# List of parts in this category
|
||||
parts = PartSerializer(many=True, read_only=True)
|
||||
|
||||
# List of child categories under this one
|
||||
children = PartCategoryBriefSerializer(many=True, read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = PartCategory
|
||||
fields = ('pk',
|
||||
'name',
|
||||
'description',
|
||||
'parent',
|
||||
'path',
|
||||
'children',
|
||||
'parts')
|
||||
'path')
|
||||
|
||||
|
||||
class PartTemplateSerializer(serializers.ModelSerializer):
|
||||
|
Reference in New Issue
Block a user