InvenTree/InvenTree/label/serializers.py
2021-01-08 23:08:30 +11:00

46 lines
1.0 KiB
Python

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from InvenTree.serializers import InvenTreeModelSerializer
from InvenTree.serializers import InvenTreeAttachmentSerializerField
from .models import 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',
]