mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-15 09:21:26 +00:00
Adds API endpoints and serializers
This commit is contained in:
@ -25,7 +25,7 @@ from InvenTree.status_codes import BuildStatus, PurchaseOrderStatus
|
||||
from stock.models import StockItem
|
||||
|
||||
from .models import (BomItem, BomItemSubstitute,
|
||||
Part, PartAttachment, PartCategory,
|
||||
Part, PartAttachment, PartCategory, PartRelated,
|
||||
PartParameter, PartParameterTemplate, PartSellPriceBreak,
|
||||
PartStar, PartTestTemplate, PartCategoryParameterTemplate,
|
||||
PartInternalPriceBreak)
|
||||
@ -225,6 +225,20 @@ class PartBriefSerializer(InvenTreeModelSerializer):
|
||||
]
|
||||
|
||||
|
||||
class PartRelationSerializer(InvenTreeModelSerializer):
|
||||
"""
|
||||
Serializer for a PartRelated model
|
||||
"""
|
||||
|
||||
class Meta:
|
||||
model = PartRelated
|
||||
fields = [
|
||||
'pk',
|
||||
'part_1',
|
||||
'part_2',
|
||||
]
|
||||
|
||||
|
||||
class PartSerializer(InvenTreeModelSerializer):
|
||||
""" Serializer for complete detail information of a part.
|
||||
Used when displaying all details of a single component.
|
||||
|
Reference in New Issue
Block a user