Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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