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

Don't render full category information in part API

- Lots of data duplication!
- Just send the category ID (and the category name)
-
This commit is contained in:
Oliver Walters
2019-04-15 22:52:53 +10:00
parent ac0b28a06c
commit 3d9a1acc2e
3 changed files with 5 additions and 4 deletions

View File

@ -43,7 +43,7 @@ class PartSerializer(serializers.ModelSerializer):
"""
url = serializers.CharField(source='get_absolute_url', read_only=True)
category = CategorySerializer(many=False, read_only=True)
category_name = serializers.CharField(source='category_path', read_only=True)
class Meta:
model = Part
@ -55,6 +55,7 @@ class PartSerializer(serializers.ModelSerializer):
'URL', # Link to an external URL (optional)
'description',
'category',
'category_name',
'total_stock',
'available_stock',
'units',