Tsallaka zuwa abun ciki
Justice Tech School

Reverse Relations

comment_set reads the other side.

Example
post = Post.objects.first()
post.comment_set.all()
# or related_name="comments" -> post.comments.all()

Exercise

Reverse name.

post.comment.all()

Quiz Test

What does related_name change?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.