I’m using the stock Django comments framework. What’s the best way to add a checkbox to the comment form to allow commenters to be notified of future comments?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This isn’t built into the django comment framework so you have to do it yourself.
You could subclass the
Commentmodel to include a boolean field that tracks whether or not the commenter want’s to be notified on that comment, then wrap thepost_commentview to detect this settings – for every new comment that is made, collect all the other comments for that object and create a list of the users that want to be notified, then usedjango-notificationsor similar to actually send the notifictions.On the frontend you simply need to overwrite the
templates/comments/form.htmlto include your new field so that should be easy enough.This is too high level to give any code samples, so you’ll have to work on it yourself and come back when there are problems.