from playlist.models import Track
from rest_framework import serializers

class TrackSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Track
        fields = '__all__'
        extra_kwargs = {
            'url': {'view_name': 'api-track', 'lookup_field': 'id'},
            'artists': {'view_name': 'api-artist', 'lookup_field': 'id'},
            'album': {'view_name': 'api-album', 'lookup_field': 'id'},
            'nominated_by': {'view_name': 'api-user', 'lookup_field': 'id'}
        }
