Skip to content

Commit

Permalink
Add ArtistSerializer to music serializers file
Browse files Browse the repository at this point in the history
This commit adds ArtistSerializer to the music/serializers.py file. This serializer class will be used to control how Artist model instances are converted to and validated against JSON data. It currently specifies 'name' as the only field to be serialized.
  • Loading branch information
lipemorais committed Apr 21, 2024
1 parent 45ff163 commit f15026d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions first_api/music/serializers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from rest_framework import serializers

from music.models import Artist


class ArtistSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Artist
fields = ['name']

0 comments on commit f15026d

Please sign in to comment.