Skip to content

Commit f15026d

Browse files
committed
Add ArtistSerializer to music serializers file
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.
1 parent 45ff163 commit f15026d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

first_api/music/serializers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from rest_framework import serializers
2+
3+
from music.models import Artist
4+
5+
6+
class ArtistSerializer(serializers.HyperlinkedModelSerializer):
7+
class Meta:
8+
model = Artist
9+
fields = ['name']

0 commit comments

Comments
 (0)