2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-01 04:56:45 +00:00
InvenTree/InvenTree/label/serializers.py
2022-05-20 17:24:51 +02:00

62 lines
1.3 KiB
Python

from InvenTree.serializers import (InvenTreeAttachmentSerializerField,
InvenTreeModelSerializer)
from .models import PartLabel, StockItemLabel, StockLocationLabel
class StockItemLabelSerializer(InvenTreeModelSerializer):
"""
Serializes a StockItemLabel object.
"""
label = InvenTreeAttachmentSerializerField(required=True)
class Meta:
model = StockItemLabel
fields = [
'pk',
'name',
'description',
'label',
'filters',
'enabled',
]
class StockLocationLabelSerializer(InvenTreeModelSerializer):
"""
Serializes a StockLocationLabel object
"""
label = InvenTreeAttachmentSerializerField(required=True)
class Meta:
model = StockLocationLabel
fields = [
'pk',
'name',
'description',
'label',
'filters',
'enabled',
]
class PartLabelSerializer(InvenTreeModelSerializer):
"""
Serializes a PartLabel object
"""
label = InvenTreeAttachmentSerializerField(required=True)
class Meta:
model = PartLabel
fields = [
'pk',
'name',
'description',
'label',
'filters',
'enabled',
]