Reusable application for Django allowing users to flag/bookmark site objects
Project description
https://github.com/idlesign/django-siteflags
Description
Reusable application for Django allowing users to flag/bookmark site objects
So you want a user to be able to put some flags on certain site entities.
Let’s say you need a kind of bookmark powered service, or a site where content is flagged and moderated, or a simplified rating system or something similar.
Inherit you model from siteflags.models.ModelWithFlag and you’re almost done.
Like that:
# myapp/models.py
from siteflags.models import ModelWithFlag
class Article(ModelWithFlag):
... # Some model fields here.
And like so:
# myapp/views.py
from django.shortcuts import get_object_or_404
from .models import Article
def article_details(request, id):
article = get_object_or_404(Article, pk=id)
...
# Now a user adds this article to his bookmarks.
article.set_flag(request.user)
...
Quite simple.
Documentation
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
django-siteflags-1.0.0.tar.gz
(16.1 kB
view hashes)
Built Distribution
Close
Hashes for django_siteflags-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3c679ab6ac11edabf80d4796fd7aeb2b109aa2adb45e09bdd3c1441b237fdb9 |
|
MD5 | d2dead3dad88c48ac1224265b096f14c |
|
BLAKE2b-256 | 986c72949bc3123be276a650e5a9f496bb584e75b6e43d7521a0d632341f2955 |