Skip to content

A restful comment system using modified preordered tree traversal ala. slashdot

Notifications You must be signed in to change notification settings

emilian/django-mptt-comments

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 

Repository files navigation

Django Mptt Comments

Django Mptt Comments is a simple way to display threaded comments instead of the django contrib comments.

Installation

  1. Get the required third party modules

    svn checkout http://django-mptt.googlecode.com/svn/trunk/mptt
    
    svn checkout http://django-template-utils.googlecode.com/svn/trunk/template_utils
    
  2. Get Mptt Comments

    git clone git://github.com/thoas/django-mptt-comments.git

  3. Add the mptt_comments directory to your Python path.

  4. Add the needed apps to INSTALLED_APPS

    'django.contrib.comments',
    'django.contrib.markup',
    'template_utils',
    'mptt',
    'mptt_comments'
    
  5. Add mptt_comments.urls to your projects urlconf

    (r'^comments/', include('mptt_comments.urls')),
    
  6. Add the required code to the objects detail page (see Usage)

  7. Copy the templates to adapt them for your site

  8. Style the forms using css

Usage

In any detail template that wants to use mptt_comments

{% block extrahead %}

{% load mptt_comments_tags %}
{% mptt_comments_media %}

{% endblock extrahead %}

To display the toplevel tree in templates:

{% load mptt_comments_tags %}

{% display_comment_toplevel_for object %}

SETTINGS

MPTT_COMMENTS_OFFSET

Number of comments displayed before 'read more' link appears

MPTT_COMMENTS_CUTOFF

Depth of comments to be shown

MPTT_COMMENTS_SELECT_RELATED

Additional related objects to be used in select_related call for example ['user__designer', 'user__designer__level']

Use patch from ticket #7270 if you need reverse OneToOne lookups like in example above

TODO

  • Make the more link work without javascript

Contributors

Михаил Сычёв (Mike) Florent Messa (thoas)

About

A restful comment system using modified preordered tree traversal ala. slashdot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published