mirror of
https://github.com/Ai-hack-MAGNUM-OPUS/backend.git
synced 2024-12-01 04:13:43 +03:00
15 lines
399 B
Python
15 lines
399 B
Python
|
from django.core.files.uploadedfile import InMemoryUploadedFile
|
||
|
from rest_framework import serializers
|
||
|
|
||
|
from checker.models import Docx
|
||
|
|
||
|
|
||
|
class DocxSerializer(serializers.ModelSerializer):
|
||
|
class Meta:
|
||
|
model = Docx
|
||
|
fields = ["uuid", "file"]
|
||
|
extra_kwargs = {"uuid": {"read_only": True}}
|
||
|
|
||
|
def validate_file(self, file: InMemoryUploadedFile):
|
||
|
return file
|