2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 12:06:44 +00:00
InvenTree/InvenTree/part/serializers.py
Oliver ed61ebe5b7 Starting to implement BOM management
- Each part can be made of other parts
- Disable tracking and project apps for now
- Project will change (eventually) to work order
- Part parameters have been disabled (for now)
2018-04-12 16:27:26 +10:00

56 lines
1.3 KiB
Python

from rest_framework import serializers
from .models import Part, PartCategory
"""
class PartParameterSerializer(serializers.HyperlinkedModelSerializer):
" Serializer for a PartParameter
"
class Meta:
model = PartParameter
fields = ('url',
'part',
'template',
'name',
'value',
'units')
"""
class PartSerializer(serializers.HyperlinkedModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
class Meta:
model = Part
fields = ('url',
'name',
'IPN',
'description',
'category',
'stock',
'units',
'trackable')
class PartCategorySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = PartCategory
fields = ('url',
'name',
'description',
'parent',
'path')
"""
class PartTemplateSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = PartParameterTemplate
fields = ('url',
'name',
'units',
'format')
"""