Permalink
Browse files

added the create_notice_type wrapper in models

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...
1 parent 309aea4 commit 73176ecaba0e6ba926ef18420daf526efbdefb1e Bastien committed May 2, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 notification/models.py
@@ -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)

0 comments on commit 73176ec

Please sign in to comment.