Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 7 days 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 (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-23T10:02:18.000Z (over 9 years ago)
- Last Synced: 2024-10-11T21:53:59.873Z (about 1 month 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