2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-13 02:25:38 +00:00

Expose test templates to the API

This commit is contained in:
Oliver Walters
2020-05-17 13:56:49 +10:00
parent f791ac9f57
commit 4d992ea528
2 changed files with 63 additions and 2 deletions

View File

@ -10,6 +10,7 @@ from .models import PartCategory
from .models import BomItem
from .models import PartParameter, PartParameterTemplate
from .models import PartAttachment
from .models import PartTestTemplate
from decimal import Decimal
@ -56,6 +57,22 @@ class PartAttachmentSerializer(InvenTreeModelSerializer):
]
class PartTestTemplateSerializer(InvenTreeModelSerializer):
"""
Serializer for the PartTestTemplate class
"""
class Meta:
model = PartTestTemplate
fields = [
'pk',
'part',
'test_name',
'required'
]
class PartThumbSerializer(serializers.Serializer):
"""
Serializer for the 'image' field of the Part model.