django-flaggit
django-flaggit enables content flagging.
Installation
pip install django-flaggit
Usage:
Add flaggit to your INSTALLED_APPS
Include flaggit.urls into your URLs if you plan on using the view and template tag:
urlpatterns = patterns('', url('^', include('flaggit.urls')), )
Test
Follow above steps and run
python manage.py test flaggit
API
Models
flaggit.models.Flag
flaggit.models.FlagInstance
Utils
- flaggit.utils.flag(obj, user=None, ip=None, comment=None):
Flag an obj, returns a FlagInstance
Signals
- flaggit.signals.flagged(flag):
Sent when something is flagged. Can be used to notify moderators.
- flaggit.signals.review(flag):
Sent when something is in review.
- flaggit.signals.rejected(flag):
Sent when some content was rejected.
- flaggit.signals.approved(flag):
Sent when some content was approved.
Here’s a template you can copy paste:
import flaggit
def handle_flagged(sender, flag, created = False, **kwargs):
if created:
# send emails
pass
else:
pass
def handle_review(sender, flag, **kwargs):
pass
def handle_rejected(sender, flag, **kwargs):
flag.content_object.delete()
flag.delete()
def handle_approved(sender, flag, **kwargs):
pass
flaggit.signals.flagged.connect(handle_flagged)
flaggit.signals.review.connect(handle_review)
flaggit.signals.rejected.connect(handle_rejected)
flaggit.signals.approved.connect(handle_approved)
Metadata
Release files for django-flaggit 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-flaggit-0.0.3.tar.gz | 7.3 kB | Without provenance | Details |
Release files / django-flaggit-0.0.3.tar.gz
| Download URL | django-flaggit-0.0.3.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6aac49d968126a1801fb09a38c68e357509dd78535688074fb4af34e7c2bc761
|
|
BLAKE2b-256 checksum How to use checksums |
28f167a024b40313d8001404d2e823975fc61f4848042c1cf97c89f178322bad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-flaggit 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.