I read the django-rest-framework nested relationship :
You can see tracksin AlbumSerializer:
class TrackSerializer(serializers.ModelSerializer):
class Meta:
model = Track
fields = ('order', 'title', 'duration')
class AlbumSerializer(serializers.ModelSerializer):
tracks = TrackSerializer(many=True, read_only=True)
class Meta:
model = Album
fields = ('album_name', 'artist', 'tracks')
The official site does not provide a way of pagination tracksin AlbumSerializer, if the number of tracks is too large, how to implement pagination for tracks?
EDIT
I want to paginate by passing the page number to the API.
source
share