mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 01:55:39 +00:00
API endpoint for accessing part star information
This commit is contained in:
@ -4,8 +4,10 @@ JSON serializers for Part app
|
||||
|
||||
from rest_framework import serializers
|
||||
|
||||
from .models import Part, PartCategory, BomItem
|
||||
from .models import Part, PartStar, PartAttachment
|
||||
from .models import SupplierPart, SupplierPriceBreak
|
||||
from .models import PartCategory
|
||||
from .models import BomItem
|
||||
|
||||
from InvenTree.serializers import InvenTreeModelSerializer
|
||||
|
||||
@ -75,6 +77,22 @@ class PartSerializer(serializers.ModelSerializer):
|
||||
]
|
||||
|
||||
|
||||
class PartStarSerializer(InvenTreeModelSerializer):
|
||||
""" Serializer for a PartStar object """
|
||||
|
||||
partname = serializers.CharField(source='part.name', read_only=True)
|
||||
username = serializers.CharField(source='user.username', read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = PartStar
|
||||
fields = [
|
||||
'part',
|
||||
'partname',
|
||||
'user',
|
||||
'username',
|
||||
]
|
||||
|
||||
|
||||
class BomItemSerializer(InvenTreeModelSerializer):
|
||||
""" Serializer for BomItem object """
|
||||
|
||||
|
Reference in New Issue
Block a user