https://github.com/theskumar/django-likes-app
A sample django app to implement project level liking of various django objects. It can also be used to implement voting, banning, etc. in your project.
https://github.com/theskumar/django-likes-app
Last synced: 8 months ago
JSON representation
A sample django app to implement project level liking of various django objects. It can also be used to implement voting, banning, etc. in your project.
- Host: GitHub
- URL: https://github.com/theskumar/django-likes-app
- Owner: theskumar
- Created: 2015-01-14T10:02:43.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-23T10:02:18.000Z (over 11 years ago)
- Last Synced: 2025-02-16T16:36:18.037Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 160 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A sample django app to implement project level liking of various django objects. It can also be used to implement voting, banning, etc. in your project.
## Public Interfaces:
### `services.remove_like(obj, user)`
Remove an user like from an object.
### `services.add_like(obj, user)`
Add a like to an object.
### `services.get_liked(user_or_id, model)`
Get the objects liked by an user.
### `services.has_liked(obj, user_or_id)`
Whether the objects is liked by an user.
### `services.get_likes_count(obj)`
Get the number of likes an object has.
### `services.get_likers(obj)`
Get the likers of an object.
---
It makes use of caching to avoid database queries, so you don't have to.
__Disclaimer:__ This is work in progress, but it's stable enough to be used in any project and is being used in live projects. Do read the soucrce code to understand the working.
## LICENSE
MIT