Django Admin Comments
A reusable Django application that adds simple admin-panel comments to any model, allowing Django Administrators to communicate on certain objects more easily.
Quickstart
-
Install Django Admin Comments:
$ pip install django-admin-comments
-
Add it to your
INSTALLED_APPS
:INSTALLED_APPS = ( ... 'admin_comments', ... )
-
Run database migrations
$ manage.py migrate
-
Now, simply add the
CommentInline
to anyModelAdmin
from admin_comments.admin import CommentInline class MyModelAdmin(admin.ModelAdmin): model = MyModel inlines = [CommentInline,]
Settings
-
ADMIN_COMMENTS_SHOW_EMPTY
: Should the comment forms display an empty form field by default? (Default:False
)Example:
ADMIN_COMMENTS_SHOW_EMPTY = True
-
ADMIN_COMMENTS_FORM_CLASS
: Override the default class used for the comment form. (Default:"admin_comments.forms.CommentInlineForm"
)Example:
ADMIN_COMMENTS_FORM_CLASS = "myapp.forms.MyCustomCommentForm"
-
ADMIN_COMMENTS_FORMSET_CLASS
: Override the default class used for the comment formset. (Default:"admin_comments.forms.CommentInlineFormset"
)Example:
ADMIN_COMMENTS_FORMSET_CLASS = "myapp.forms.MyCustomCommentFormSet"
Features
- Generic comment model to add comments to any object
- Simple configuration without the overhead of the Django Comments Framework
- Overridable Form and Formset classes
Support
Python
- 2.7
- 3.4
- 3.5
- 3.6
Django
- 1.8
- 1.9
- 1.10
- 1.11
- 2.0
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install -r requirements_dev.txt (myenv) $ pip install -r requirements_test.txt (myenv) $ tox
Credits
Original inspiration from Dryice Liu's answer on the following post:
https://stackoverflow.com/a/30338979/3768332
Tools used in rendering this package: