from rest_framework import serializers

from .. import models

__all__ = ("SoundSerializer",)


class SoundSerializer(serializers.ModelSerializer):
    file = serializers.FileField(use_url=False)

    class Meta:
        model = models.Sound
        fields = [
            "id",
            "name",
            "program",
            "file",
            "duration",
            "mtime",
            "is_good_quality",
            "is_public",
            "is_downloadable",
            "url",
        ]
