Django app providing view interface to django-secretballot.
Project description
Django Likes
Django app providing view interface to django-secretballot.
This app utilizes django-secretballot to provide Facebook or Google+1 style item liking of Django model objects. Authenticated or anonymous users are allowed to like any given object only once.
Installation
Install or add django-likes to your Python path.
Configure django-secretballot as described here
Add likes to your INSTALLED_APPS setting.
Add likes url include to your project’s urls.py file:
(r'^likes/', include('likes.urls')),
Add likes.middleware.SecretBallotUserIpUseragentMiddleware to your MIDDLEWARE_CLASSES setting, i.e.:
MIDDLEWARE_CLASSES = ( ...other middleware classes... "likes.middleware.SecretBallotUserIpUseragentMiddleware", )
Add django.core.context_processors.request to your TEMPLATE_CONTEXT_PROCESSORS setting, i.e.:
TEMPLATE_CONTEXT_PROCESSORS = ( ...other context processors... "django.core.context_processors.request", )
Usage
Signals
likes.signals.likes_enabled_test
To determine whether or not liking/voting should be enabled on an object, connect a signal handler to the likes.signals.likes_enabled_test signal, raising a likes.exceptions.LikesNotEnabledException if liking should be disabled. The default behaviour is that liking is enabled for all secretballot enabled objects.
likes.signals.can_vote_test
To determine whether or not the current requesting user can vote, connect a signal handler to the likes.signals.can_vote_test signal, raising a likes.exceptions.CannotVoteException if the current user should not be allowed to vote (the handler receives a request object). The default behaviour is that all users can vote except if they have previously voted on the object in question.
Praekelt Foundation
Shaun Sephton
Jonathan Bydendyk
Hedley Roos
Changelog
0.0.7 (2012-08-20)
Revert to vote_total on inclusion tag.
0.0.6 (2012-07-24)
Allow for downvotes.
0.0.5 (2011-09-15)
Corrected manifest to include missing static resources.
0.0.4 (2011-09-14)
Documentation, number of fixes.
0.0.3
Handle multiple likes buttons on the same page
Remove dependency on jmbo
Unit tests
0.0.2
Prevent local cache on like redirect.
0.0.1
Initial release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-likes-0.0.7.tar.gz
.
File metadata
- Download URL: django-likes-0.0.7.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4960f1c96e8467c539e6cc0c7640ed6ce202eb74c479e236db8dbea911956da8 |
|
MD5 | f05b51c8e5563e88ba0b74d5a44fe112 |
|
BLAKE2b-256 | acddcc6c199cdb8c500888ed02d67348bbad6a3116d7ed2f5d22c976b1be8a77 |
Provenance
File details
Details for the file django_likes-0.0.7-py2.7.egg
.
File metadata
- Download URL: django_likes-0.0.7-py2.7.egg
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed25e55507cbe14518c4fa5ec3ba0a820297e90e2d2b4bd71e1f23248d3b835d |
|
MD5 | ab12d7dd260d388c4db43563c1d73f36 |
|
BLAKE2b-256 | 7109e98fc8652ff45a0ccf86fdd2c03e006b7182303ebc85c76cc55807835331 |