V1.30.2 notification settings
This commit is contained in:
parent
080fed215f
commit
c65f0df01e
@ -1,8 +1,29 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from aitrainer_backoffice.models.notification import Notification
|
#from aitrainer_backoffice.models.notification import Notification
|
||||||
from ..models import Customer
|
from ..models import Customer
|
||||||
|
|
||||||
|
class Notification(models.Model):
|
||||||
|
notification_id = models.AutoField(primary_key=True)
|
||||||
|
message_title = models.CharField(max_length=50)
|
||||||
|
message_body = models.TextField(max_length=100, blank=True, null=True)
|
||||||
|
image_url = models.ImageField(upload_to='images/', help_text='The notification image')
|
||||||
|
schedule_date = models.DateField(blank=True, null=True)
|
||||||
|
schedule_hook = models.TextField(max_length=100, blank=True, null=True)
|
||||||
|
schedule_sql = models.TextField(max_length=1000, blank=True, null=True)
|
||||||
|
internal_name = models.CharField(max_length=50, blank=True, null=True)
|
||||||
|
internal_description = models.TextField(max_length=500, blank=True, null=True)
|
||||||
|
active = models.BooleanField(default=0)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
db_table = 'notification'
|
||||||
|
verbose_name = _("Notification")
|
||||||
|
verbose_name_plural = _("Notifications")
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.internal_name
|
||||||
|
|
||||||
class NotificationHistory(models.Model):
|
class NotificationHistory(models.Model):
|
||||||
notification_history_id = models.AutoField(primary_key=True)
|
notification_history_id = models.AutoField(primary_key=True)
|
||||||
notification = models.ForeignKey(Notification, on_delete=models.CASCADE)
|
notification = models.ForeignKey(Notification, on_delete=models.CASCADE)
|
||||||
|
Loading…
Reference in New Issue
Block a user