Giter Site home page Giter Site logo

pekopt / django-comments-tree Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sharpertool/django-comments-tree

0.0 0.0 0.0 3.82 MB

Django comments app with thread support, follow-up notifications, mail confirmation, like/dislike flags and moderation.

Home Page: https://django-comments-tree.readthedocs.io/en/latest/

License: BSD 2-Clause "Simplified" License

Python 74.07% CSS 2.44% JavaScript 7.66% HTML 14.20% Shell 1.50% Dockerfile 0.13%

django-comments-tree's Introduction

django-comments-tree TravisCI

A Django pluggable application that adds comments to your project.

https://github.com/sharpertool/django-comments-tree/blob/master/docs/images/cover.png

It extends the once official django-contrib-comments with the following features:

  1. Comments model based on django-treebeard to provide a robust and fast threaded and nested comment structure.
  2. Efficiently associate a comment tree with any model through a link table which avoids populating each comment with extra link data.
  3. Customizable maximum thread level, either for all models or on a per app.model basis.
  4. Optional notifications on follow-up comments via email.
  5. Mute links to allow cancellation of follow-up notifications.
  6. Comment confirmation via email when users are not authenticated.
  7. Comments hit the database only after they have been confirmed.
  8. Registered users can like/dislike comments and can suggest comments removal.
  9. Template tags to list/render the last N comments posted to any given list of app.model pairs.
  10. Emails sent through threads (can be disable to allow other solutions, like a Celery app).
  11. Fully functional JavaScript plugin using ReactJS, jQuery, Bootstrap, Remarkable and MD5.

Example sites and tests work under officially Django supported versions:

  • Django 2.2, 2.1, 2.0 and 1.11
  • Python 3.6, 3.5, 3.4, 3.2 and 2.7

Additional Dependencies:

  • django-contrib-comments >=1.8, <1.9
  • djangorestframework >=3.8, <3.9

Checkout the Docker image danirus/django-comments-tree-demo.

Read The Docs.

Why Create a New Package

I did not particularly like how the core django-contrib-comments added a GenericForeignKey to each and every comment in order to associate a comment stream with another model. I wanted to have a single place where this association was made.

I opted to add a model just for linking the comments to other models. This model has a single record for a model -> comment-tree association. The record contains the GenericForeignKey, and a single ForeignKey to the comments root node that starts the comments for that model. This is very flexible, and if the underlying model changes, it is a simple matter to move all comments to a new parent. Treebeard just makes all of this work.

Treebeard provides robust mechanisms to get the parent, children, siblings, and any other association you might needed from the comment stream. This also makes it much easier to have a very robust tree structure, so nesting, replies, replies to replies, etc. are easy to handle, and very efficient.

Attribution

This package is a fork of the excellent work at django-comments-xtd

I created the fork because I wanted to a comment tree based on MP_node from django-treebeard. I consider this to be a more robust tree implementation. Treebeard suppports multiple root nodes, so each root node can be an entire comment tree.

django-comments-tree's People

Contributors

alej0varas avatar andytwoods avatar blag avatar c14l avatar cmacmackin avatar danirus avatar fcurella avatar hornn avatar ivansurov avatar khanmaytok avatar kutenai avatar mands avatar mikhail-sakhnov avatar ojh avatar pekopt avatar rabogaa avatar rczajka avatar richardasymmetric avatar sanastasiou avatar terotik avatar tombreit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.