This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

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)

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.


@flashingpumpkin

Release History

Release History

0.0.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-flaggit-0.0.3.tar.gz (7.3 kB) Copy SHA256 Checksum SHA256 Source Aug 5, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting