How to extend the django-comments model <p>(Sorry for my bad english, i'm a shabby French)</p> <p>I try to extend the django comment framework to add a like/dislike system. After read <a href="https://docs.djangoproject.com/en/1.7/ref/contrib/comments/custom/#an-example-custom-comments-app" rel="nofollow">the documentation</a>, i have added this to my <strong>model.py</strong> :</p> <pre><code>from django.contrib.comments.models import Comment class Commentslikes(Comment): positif = models.IntegerField(default=0) negatif = models.IntegerField(default=0) </code></pre> <p>After launch the command <code>python manage.py syncdb</code>, django have created the <strong>commentslikes</strong> mysql table with 3 cols : <em>comment_ptr_id</em>, <em>positif</em>, <em>negatif</em> . It's ok.</p> <p>In my <strong>view.py</strong> file, i have override the comment post view with this : </p> <pre><code> def custom_comment_post(request, next=None, using=None): #Post the comment and get the response response = contrib_comments.post_comment(request, next, using) if type(response) == HttpResponseRedirect: redirect_path, comment_id = response.get('Location').split( '?c=' ) if comment_id: comment = Comment.objects.get( id=comment_id ) if comment: #For test, i try to add 20 positif likes, 10 dislikes and edit the comment with 'foo' comment.positif = 20 comment.negatif = 10 comment.comment = 'foo' comment.save() return HttpResponseRedirect( redirect_path + "#c" + comment_id) return response </code></pre> <p>Then I posted a test comment. Comment has been modified with 'foo' but no rows have been added in the <strong>commentslikes</strong> table with the id of comment, positif at 20 and negatif at 10. Not row for the comment has added in <strong>commentslikes</strong></p> <p>I have forgotten or done something ?</p> <p>Thanks, Thomas</p>