from playlist.models import Profile, Background
from rest_framework import serializers

class BackgroundSerializer(serializers.ModelSerializer):
    class Meta:
        model = Background
        fields = '__all__'

class ProfileSerializer(serializers.ModelSerializer):
    background = BackgroundSerializer()

    class Meta:
        model = Profile
        fields = '__all__'

class ProfileUpdateSerializer(serializers.ModelSerializer):
    background = serializers.PrimaryKeyRelatedField(many=False, queryset=Background.objects.all())
    class Meta:
        model = Profile
        fields = ['background']
