~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to pybb/management/pybb_notifications.py

  • Committer: Holger Rapp
  • Date: 2009-02-26 22:38:49 UTC
  • Revision ID: sirver@kallisto.local-20090226223849-1563ij0uuw0lz0zu
First version of widelands online help

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from django.db.models import signals
2
 
 
3
 
from django.utils.translation import ugettext_noop as _
4
 
 
5
 
try:
6
 
    from notification import models as notification
7
 
 
8
 
    def create_notice_types(app, created_models, verbosity, **kwargs):
9
 
        notification.create_notice_type("forum_new_topic",
10
 
                                        _("Forum New Topic"),
11
 
                                        _("a new topic has been added to the forum"),
12
 
                                        default=1)
13
 
        notification.create_notice_type("forum_new_post",
14
 
                                        _("Forum New Post"),
15
 
                                        _("a new comment has been posted to a topic you observe"))
16
 
 
17
 
    signals.post_syncdb.connect(create_notice_types,
18
 
                                sender=notification)
19
 
except ImportError:
20
 
    print "Skipping creation of NoticeTypes as notification app not found"