mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 08:39:24 +02:00
See #170: can now subscribe/unsubscribe to channel
This commit is contained in:
parent
fc850e6e5d
commit
4236cc6274
5 changed files with 104 additions and 1 deletions
|
@ -96,3 +96,15 @@ class ChannelSerializer(serializers.ModelSerializer):
|
|||
|
||||
def get_artist(self, obj):
|
||||
return music_serializers.serialize_artist_simple(obj.artist)
|
||||
|
||||
|
||||
class SubscriptionSerializer(serializers.Serializer):
|
||||
approved = serializers.BooleanField(read_only=True)
|
||||
fid = serializers.URLField(read_only=True)
|
||||
uuid = serializers.UUIDField(read_only=True)
|
||||
creation_date = serializers.DateTimeField(read_only=True)
|
||||
|
||||
def to_representation(self, obj):
|
||||
data = super().to_representation(obj)
|
||||
data["channel"] = ChannelSerializer(obj.target.channel).data
|
||||
return data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue