https://github.com/druids/django-user-comments
https://github.com/druids/django-user-comments
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/druids/django-user-comments
- Owner: druids
- Created: 2018-11-14T14:37:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-18T23:58:12.000Z (over 3 years ago)
- Last Synced: 2025-01-30T02:14:16.329Z (over 1 year ago)
- Language: Python
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
User comments
=============
Prologue
--------
User comments adds model for commenting django model instances for example in the administration. It's simpler version of django-contrib-comments
Prerequisites
-------------
- django-chamber~=0.4.6
Installation
------------
```python
pip install django-user-comments
```
Configuration
-------------
For using django-user-comments you just add add ``user_comments`` to ``INSTALLED_APPS`` setting:
```python
INSTALLED_APPS = (
...
'user_comments',
...
)
```
Django-is-core
--------------
You can use user comments with django-is-core framework:
```python
from is_core.main import UIRESTModelISCore
from user_comments.contrib.is_core.cores import CommentISCoreMixin
class UserCore(CommentISCoreMixin, DjangoUiRestCore):
model = User
form_fieldsets = (
(None, {
'fields': 'username', 'first_name', 'last_name'
})
) + CommentCoreMixin.notes_form_fieldset
```
The CommentISCoreMixin only sets ``form_class`` attribute and contains ``notes_form_fieldset`` setting.
If you need change form of the core. You must extend from ``user_comments.contrib.is_core.cores.CommentUIForm``
```python
from user_comments.contrib.is_core.cores import CommentUiForm
e
class UserForm(CommentUiForm):
...
class UserCore(CommentCoreMixin, DjangoUiRestCore):
model = User
form_class = UserForm
form_fieldsets = (
(None, {
'fields': 'username', 'first_name', 'last_name'
})
) + CommentCoreMixin.notes_form_fieldset
```