mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-06 02:11:16 +00:00
Add ability to add part file attachments via the API
This commit is contained in:
1 parent
f71bfb5700
commit
f36c5137dd
2 files changed
+65
-33
No files matched your search
@@ -9,6 +9,7 @@ from .models import Part, PartStar
|
||||
from .models import PartCategory
|
||||
from .models import BomItem
|
||||
from .models import PartParameter, PartParameterTemplate
|
||||
from .models import PartAttachment
|
||||
|
||||
from decimal import Decimal
|
||||
|
||||
@@ -39,6 +40,22 @@ class CategorySerializer(InvenTreeModelSerializer):
|
||||
]
|
||||
|
||||
|
||||
class PartAttachmentSerializer(InvenTreeModelSerializer):
|
||||
"""
|
||||
Serializer for the PartAttachment class
|
||||
"""
|
||||
|
||||
class Meta:
|
||||
model = PartAttachment
|
||||
|
||||
fields = [
|
||||
'pk',
|
||||
'part',
|
||||
'attachment',
|
||||
'comment'
|
||||
]
|
||||
|
||||
|
||||
class PartThumbSerializer(serializers.Serializer):
|
||||
"""
|
||||
Serializer for the 'image' field of the Part model.
|
||||
|
||||
Reference in new issue
Block a user