spradio-server-django/savepointradio/api/serializers/controls.py

23 lines
545 B
Python
Raw Normal View History

from rest_framework.serializers import (IntegerField,
ModelSerializer,
2019-06-04 18:26:09 +00:00
Serializer)
from profiles.models import SongRequest
from .radio import RadioSongSerializer
class JustPlayedSerializer(Serializer):
song_request = IntegerField()
class MakeRequestSerializer(Serializer):
song = IntegerField()
class GetRequestSerializer(ModelSerializer):
song = RadioSongSerializer()
class Meta:
model = SongRequest
fields = ('id', 'song')