mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add part detail filter to PartRelated serializer
This commit is contained in:
parent
4704845a7b
commit
88df774aef
@ -225,20 +225,6 @@ 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.
|
||||
@ -402,6 +388,25 @@ class PartSerializer(InvenTreeModelSerializer):
|
||||
]
|
||||
|
||||
|
||||
class PartRelationSerializer(InvenTreeModelSerializer):
|
||||
"""
|
||||
Serializer for a PartRelated model
|
||||
"""
|
||||
|
||||
part_1_detail = PartSerializer(source='part_1', read_only=True, many=False)
|
||||
part_2_detail = PartSerializer(source='part_1', read_only=True, many=False)
|
||||
|
||||
class Meta:
|
||||
model = PartRelated
|
||||
fields = [
|
||||
'pk',
|
||||
'part_1',
|
||||
'part_1_detail',
|
||||
'part_2',
|
||||
'part_2_detail',
|
||||
]
|
||||
|
||||
|
||||
class PartStarSerializer(InvenTreeModelSerializer):
|
||||
""" Serializer for a PartStar object """
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user