django-flaggit

Generic content flagging for Django
Download

django-flaggit Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Publisher Name:
  • Alen Mujezinovic
  • Publisher web site:
  • http://caffeinehit.com

django-flaggit Tags


django-flaggit Description

Generic content flagging for Django django-flaggit is a Django app that enables content flagging.Installation:pip install django-flaggitUsage: 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')), )TestFollow above steps and runpython manage.py test flaggitAPIModels- flaggit.models.Flag- flaggit.models.FlagInstanceUtils- flaggit.utils.flag(obj, user=None, ip=None, comment=None):- Flag an obj, returns a FlagInstanceSignals- 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 flaggitdef handle_flagged(sender, flag, created = False, **kwargs): if created: # send emails pass else: passdef handle_review(sender, flag, **kwargs): passdef handle_rejected(sender, flag, **kwargs): flag.content_object.delete() flag.delete()def handle_approved(sender, flag, **kwargs): passflaggit.signals.flagged.connect(handle_flagged)flaggit.signals.review.connect(handle_review)flaggit.signals.rejected.connect(handle_rejected)flaggit.signals.approved.connect(handle_approved)Template tags{% load flaggit_tags %}{% flag_form object %}{% flag_form object "your/custom/template.html" %}- {% flag_form object %}: Renders a form to flag object-- `{% flag_form object "your/custom/template.html" %}: Renders the form with a custom template. Requirements: · Python · Django


django-flaggit Related Software