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 django.db import models
from siteflags.models import ModelWithFlag
class Article(models.Model, 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
Built Distribution
File details
Details for the file django-siteflags-0.4.2.tar.gz
.
File metadata
- Download URL: django-siteflags-0.4.2.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b15ec3a10a1ae9cb814c312007526a21a5600561632bf51e458bfa5636ddf77a |
|
MD5 | 4a1927c48632e410381ae6373fc6a319 |
|
BLAKE2b-256 | f0af8b1bda16a701afc002dedf158e44513299e234fd0327d01c10b968ff5647 |
Provenance
File details
Details for the file django_siteflags-0.4.2-py2.py3-none-any.whl
.
File metadata
- Download URL: django_siteflags-0.4.2-py2.py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8404e833f583a72384dcaeef456d6bf90e2129e0614eb70fe4f8712be7a44d66 |
|
MD5 | f433ae9f4c3c2e02d4f83d9cbb5a21bf |
|
BLAKE2b-256 | 85c708460e575a0f328ccd149ff60e53af2bfe098b68a65022bd28c3cc736eba |