python-dirbtuves / website

Python dirbtuvės project web site.
GNU Affero General Public License v3.0
2 stars 0 forks source link

Add custom app for creating comments reply #60

Closed iakovleva closed 9 years ago

iakovleva commented 9 years ago

Implements #56

iakovleva commented 9 years ago

I created custom app and set parent_comment as the attribute of the custom model ParentComment(Comment). It should be recursive to Comment model but not to itself, isn't it?

At the moment a form for the reply is displayed in the template. But reply isn't connected with its parent_comment. How to connect them?

Should not be there a comment tree? I suppose that using django_comments for comments with reply is quite tricky.

niekas commented 9 years ago

Yes, this task was tricky and harder than I fought. I've just looked at django_comments module in more details and found out, that custom comment_parent field wasn't needed at all, because Comment.content_object can be any type object. So instead of recursive child relationship we could be commenting a comment. Sorry for guiding you to wrong way.

This task required recusancy in templates, so I decided to partially implement it. You should make code review, improve test_comments.py to test ability to reply to comment.