threadedtopics

There are several forum and comment apps for Django. After evaluating them we decided django-threadedcomments offers the most flexibility with a couple of key features we needed.

However, django-threadedcomments only offers comment threads as commonly used in blogs. In addition to that, we needed a forum/topic/thread type solution. Fortunately the way django-threadedcomments is build makes it easy to augment its functionality to that direction.

Generic relations are brilliant. Django-threadedcomments uses them to allow comments and threads to be attached to any object.

Our "threadedtopics" app (currently a proof-of-concept) together with threadedcomments groups comments in threads under topics, which in turn can be attached to any object with a generic relation.

A major benefit from this solution is that the original functionality of threadedcomments remains, so other parts of a site can still attach comments to any objects. This way there's no need to learn and integrate another complete forum app in addition to threadedcomments.

An example of how to build a forum system with threadedtopics:

  • Topic objects have a generic foreign key
  • Topic objects are attached to e.g. a FlatPage with a "forum" template
  • the forum template lists topics attached to the FlatPage with a form for starting a new topic plus an initial comment
  • clicking on topics might open the thread on a separate page or open it dynamically in-place using the "topic" template
  • the topic template uses threadedcomments to show the thread and a new comment form

(The "threadedtopics" name is maybe a little misleading, since there is no topic hierarchy – it refers to the comment threads inside topics.)


This is all the documentation we have for now. How this evolves will be seen after we implement a complete forum solution and/or receive feedback from the django-threadedcomments author or other members of the community.


In django-threadedcomments issue #14 we made two suggestions:

1) Having the forum/topic functionality in a separate app seems to work well at least for us. An integrated solution could be easier for someone else.

2) I had to copy and customize a bunch of code from threadedcomments to my threadedtopics app to make this work, part of which could be avoided with a little code reorganization in threadedcomments.