I have comment model that references (foreign key) a post model and there is a boolean field in the post model that tells whether this particular post has any comment or not.
What I want to do is to update this boolean field of the post whenever a comment is made on that post, for this what do I have to do in the view.
Also when I show all the posts on a page, I want to show those first which do not have any comment, so that people can comment on them.
How can I effectively do the following two things