honzakral/django-threadedcomments

Сomment field in modal

Opened this issue · 1 comments

Thanks for this project!

I have question. I have model "Project". I use django-reversion app to controll model changes. I want field comments in my model cause I need to controll what kind of comments was in Project object. Right now commection with object and comment takes place in templates with the help of {% render_comment_form for object %}. How I can create such field in my model corrently?

models.py:

class Project(models.Model):
         comments = models.ManyToManyField(Comment, through='Comment', help_text=_('Comment'))

Django comments use a generic foreign key, so creating a reverse relation is a bit difficult.

It can be done through, see https://github.com/django-fluent/django-fluent-comments/blob/master/fluent_comments/models.py#L94 for an example