from django.db.models.functions import Extract
from playlist.models import Album
from rest_framework import serializers

class AlbumSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Album
        fields = '__all__'
        extra_kwargs = {
            'url': {'view_name': 'api-album', 'lookup_field': 'id'},
            'artists': {'view_name': 'api-artist', 'lookup_field': 'id'},
        }
