sbt-idp/cope2n-api/fwd_api/request/FwdSerializer.py
2023-11-30 18:19:06 +07:00

20 lines
525 B
Python
Executable File

from rest_framework import serializers
from fwd_api.models import SubscriptionRequest
class ReportSerializer(serializers.Serializer):
files = serializers.FileField(required=False)
requestId = serializers.CharField(required=False)
def create(self, validated_data):
"""
Create and return a new `Snippet` instance, given the validated data.
"""
return SubscriptionRequest.objects.create(**validated_data)
def update(self, instance, validated_data):
return instance