From 73176ecaba0e6ba926ef18420daf526efbdefb1e Mon Sep 17 00:00:00 2001 From: Bastien Date: Fri, 3 May 2013 02:29:50 +0300 Subject: [PATCH] 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. --- notification/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/notification/models.py b/notification/models.py index 95c67d98..ae91fa13 100644 --- a/notification/models.py +++ b/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)