Reviewable
Reviewable provides simple, customizable reviews for any of your Django models. The templates for each of your reviewable models can be customised with ease.
Quick Start
$ pip install django-reviewable
Add “Reviewable” to your INSTALLED_APPS setting:
INSTALLED_APPS = [
...
'Reviewable',
...
]
Include the Reviewable URLconf in your projects urls.py:
url(r'^reviews/', include('Reviewable.urls', namespace='Reviewable')),
Run python manage.py migrate
Add the mixin Reviewable to any model you want to be reviewable.
...
from Reviewable.models import Reviewable
...
class ReviewableModel(models.Model, Reviewable):
...
Custom Templates
Reviewable allows you to customise the templates for each reviewable model. Furthemore, the reviewable object is magically made available in the template context.
- For example:
You have a model called Hotel in an app called Hotel
You want a custom template for the review creation view
- You would add a template in Hotel/templates/Hotel called hotel_review_create.html
Note: This the template name has to be in camel case and all lower case
The hotel object is made available in the template context by the usual {{ hotel }} tag
This can be repeated for templates for all views: hotel_review_list.html, hotel_review_update.html, hotel_review_confirm_delete.html and hotel_review_detail.html
Post Delete Signals
Deletion of a reviewable object won’t automatically cause a cascade delete of all of the objects reviews. Hence, it is a good idea to use the post delete signal somewhere in your app as below:
from MyApp.models import ReviewableModel
from django.db.models.signals import post_delete
...
post_delete.connect(ReviewableModel.delete_reviews, sender=ReviewableModel)
Settings
All settings are shown below with their defaults.
REVIEW_RATING_CHOICES
REVIEW_RATING_CHOICES=(
(1, '1 Star'),
(2, '2 Star'),
(3, '3 Star'),
(4, '4 Star'),
(5, '5 Star')
)
REVIEW_DELETE_SUCCESS_URL
REVIEW_DELETE_SUCCESS_URL='/'
REVIEW_STREAM_ENABLED
Reviewable can utilise GetStream if required. This would mean reviews are automatically published to your GetStream.io feed. See https://github.com/GetStream/stream-django for more information
REVIEW_STREAM_ENABLED=False
Release files for django-reviewable 0.3.9.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-reviewable-0.3.9.2.tar.gz | 7.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_reviewable-0.3.9.2-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 18.5 kB
Release files / django-reviewable-0.3.9.2.tar.gz
| Download URL | django-reviewable-0.3.9.2.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cfdcea00ec43a7b50fdc014a3607d97ffdf1b1f345a696d8899f89b9b293a46f
|
|
BLAKE2b-256 checksum How to use checksums |
20d9bd51fe46600c3d4d07488e7e6f940fa973b5ef56a875eaf03f61f11c5391
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_reviewable-0.3.9.2-py2-none-any.whl
| Download URL | django_reviewable-0.3.9.2-py2-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
3690c20a44d68198e7c02d68ee8854f8803dbe54528cd6630b2f8bb5794349e7
|
|
BLAKE2b-256 checksum How to use checksums |
772c82469238e8cec295bf94242c3c250817c5aa21ab100c69d930a05a277833
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |