mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
46 lines
1.0 KiB
Python
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',
|
|
]
|