Skip to content

file_metadata_serializer#

FileMetadataSerializer#

Bases: StrictSerializer, CommonModelSerializer

Source code in src/apps/core/serializers/file_metadata_serializer.py
class FileMetadataSerializer(StrictSerializer, CommonModelSerializer):
    file_type = FileType.get_serializer_class()(required=False)
    use_category = UseCategory.get_serializer_class()(required=True)

    class Meta:
        model = FileSetFileMetadata
        fields = ["title", "description", "file_type", "use_category"]

DirectoryMetadataSerializer#

Bases: StrictSerializer, CommonModelSerializer

Source code in src/apps/core/serializers/file_metadata_serializer.py
class DirectoryMetadataSerializer(StrictSerializer, CommonModelSerializer):
    use_category = UseCategory.get_serializer_class()(required=True)

    class Meta:
        model = FileSetDirectoryMetadata
        fields = ["title", "description", "use_category"]