mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add some more custom FileField serializers
(cherry picked from commit 7b9ff27baefacc977fef7852e99d8a9bb46a062a)
This commit is contained in:
parent
861e30e8d6
commit
81e38eeb14
@ -10,6 +10,8 @@ from rest_framework import serializers
|
|||||||
from django.db.models import Count
|
from django.db.models import Count
|
||||||
|
|
||||||
from InvenTree.serializers import InvenTreeModelSerializer
|
from InvenTree.serializers import InvenTreeModelSerializer
|
||||||
|
from InvenTree.serializers import InvenTreeAttachmentSerializerField
|
||||||
|
|
||||||
from company.serializers import CompanyBriefSerializer, SupplierPartSerializer
|
from company.serializers import CompanyBriefSerializer, SupplierPartSerializer
|
||||||
from part.serializers import PartBriefSerializer
|
from part.serializers import PartBriefSerializer
|
||||||
|
|
||||||
@ -112,6 +114,8 @@ class POAttachmentSerializer(InvenTreeModelSerializer):
|
|||||||
Serializers for the PurchaseOrderAttachment model
|
Serializers for the PurchaseOrderAttachment model
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
attachment = InvenTreeAttachmentSerializerField()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PurchaseOrderAttachment
|
model = PurchaseOrderAttachment
|
||||||
|
|
||||||
@ -255,6 +259,8 @@ class SOAttachmentSerializer(InvenTreeModelSerializer):
|
|||||||
Serializers for the SalesOrderAttachment model
|
Serializers for the SalesOrderAttachment model
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
attachment = InvenTreeAttachmentSerializerField()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = SalesOrderAttachment
|
model = SalesOrderAttachment
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ from django.db.models.functions import Coalesce
|
|||||||
|
|
||||||
from InvenTree.status_codes import StockStatus, PurchaseOrderStatus, BuildStatus
|
from InvenTree.status_codes import StockStatus, PurchaseOrderStatus, BuildStatus
|
||||||
from InvenTree.serializers import InvenTreeModelSerializer
|
from InvenTree.serializers import InvenTreeModelSerializer
|
||||||
|
from InvenTree.serializers import InvenTreeAttachmentSerializerField
|
||||||
|
|
||||||
|
|
||||||
class CategorySerializer(InvenTreeModelSerializer):
|
class CategorySerializer(InvenTreeModelSerializer):
|
||||||
@ -46,6 +47,8 @@ class PartAttachmentSerializer(InvenTreeModelSerializer):
|
|||||||
Serializer for the PartAttachment class
|
Serializer for the PartAttachment class
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
attachment = InvenTreeAttachmentSerializerField()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PartAttachment
|
model = PartAttachment
|
||||||
|
|
||||||
|
@ -212,6 +212,8 @@ class StockItemAttachmentSerializer(InvenTreeModelSerializer):
|
|||||||
|
|
||||||
user_detail = UserSerializerBrief(source='user', read_only=True)
|
user_detail = UserSerializerBrief(source='user', read_only=True)
|
||||||
|
|
||||||
|
attachment = InvenTreeAttachmentSerializerField()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = StockItemAttachment
|
model = StockItemAttachment
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user