How to make query of each parent only three 0r four child objects get in Django?

I have a list of videos which are belong from some of channels. I want to get only three videos per channel and pass as return value. My code is slice the list of videos not for all channel it's get only three objects. But i want to get each channel of three videos.

I don't understand how can i do that...

def each_channel_three_videos(request):

    videos = video.YTVideo.objects.select_related('channel')\

    context = {
        'videos': videos,
    return render(request, 'videos.html', context)

see this ( and see this ( have a goodday.

Back to Top