e7cc031588
only background for now, but hey.
21 lines
610 B
Python
21 lines
610 B
Python
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']
|