Skip to content

Commit

Permalink
added the create_notice_type wrapper in models
Browse files Browse the repository at this point in the history
In the docs it is advised to use create_notice_type to create a new NoticeType object. But this function was absent. Although it is possible to create a new NoticeType using the 'create' function of the class, this addition makes the code follow the docs and compatible with previous code and other apps.
  • Loading branch information
Bastien committed May 2, 2013
1 parent 309aea4 commit 73176ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions notification/models.py
Expand Up @@ -24,6 +24,10 @@ class LanguageStoreNotAvailable(Exception):
pass


def create_notice_type(label, display, description, **kwargs):
NoticeType.create(label, display, description, **kwargs)


class NoticeType(models.Model):

label = models.CharField(_("label"), max_length=40)
Expand Down

0 comments on commit 73176ec

Please sign in to comment.