public
Description: Sample paste bin Django application for the Pinax platform
Homepage: http://fernandoacorreia.wordpress.com/tag/pinax/
Clone URL: git://github.com/fernandoacorreia/oxybeles.git
oxybeles / management.py
100644 21 lines (17 sloc) 0.772 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from django.db.models import signals, get_app
from django.utils.translation import ugettext_noop as _
from django.core.exceptions import ImproperlyConfigured
 
try:
    notification = get_app('notification')
 
    def create_notice_types(app, created_models, verbosity, **kwargs):
        notification.create_notice_type(
            "pasteditem_received",
            _("Pasted Item Received"),
            _("you have received a pasted item"))
        notification.create_notice_type(
            "pasteditem_sent",
            _("Pasted Item Sent"),
            _("you sent a pasted item"))
 
    signals.post_syncdb.connect(create_notice_types, sender=notification)
except ImproperlyConfigured:
    print "Skipping creation of NoticeTypes as notification app not found."