Custom top message for cms
[snf-cloudcms] / cloudcms / models.py
index 37758e3..f9a5bba 100644 (file)
@@ -55,6 +55,16 @@ class Application(models.Model):
     Enabling cloudcms.context_processors.application in CONTEXT_PROCESSROS setting
     let you can access the application object throughout the html templates.
     """
+
+    MESSAGE_TYPE_CHOICES = (
+        ('NM','No Message'),
+        ('success','Success'),
+        ('error','Error'),
+        ('warning','Warning'),
+        ('info','Info'),
+    )
+
     code = models.CharField('Identifier', max_length=100, null=False, blank=False,
             help_text="Just a codename of the application, to be used in "\
                     "several places where no free text is allowed"\
@@ -80,6 +90,11 @@ class Application(models.Model):
     footer_top = models.TextField(default="", blank=True)
     footer_bottom = models.TextField(default="", blank=True)
 
+    message_type = models.CharField(max_length=20, 
+                                    choices= MESSAGE_TYPE_CHOICES,
+                                    default = 'NM' )
+    custom_message = models.TextField(default="", blank=True)
+
     @classmethod
     def current(cls):
         return cls.objects.get(site__pk=settings.SITE_ID)