Closed tian-yan closed 2 years ago
Just to be clear, your "post" is a model you have created, like would be an Article or a Story, and then you have comments to that "post". Editing those objects doesn't trigger anything in django-comments-xtd. If it does you must have custom code doing that.
I would suggest you to clone this repository and setup the demo/comp project to have another Django project to compare with. Setting up the demo projects is explained in the documentation.
thanks for the reply. I did customize the django-comments-xtd
package a bit in my deployment. I will inspect my customized code to find out.
I have an existing post with existing comments already. When I revise the post and save again, I found that existing comments were treated as new comments due to the
self.pk
in below source code,django_comments_xtd / models.py
PDB Debug Output for existing comments when revising existing post
PDB debug output when saving a new comment for existing post.
In summary, it seems that every time when I revise the existing posts and save again, the
pk
of those existing comments becomeNone
which causes those existing comments to be treated as NEW, butid
still retain its original value.Q: Shall we use
self.id
instead ofself.pk
in above source code ?