Refactoring
* splits ema/models.py into subpackage * splits konova/models.py into subpackage * splits user/models.py into subpackage
This commit is contained in:
34
user/models/notification.py
Normal file
34
user/models/notification.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""
|
||||
Author: Michel Peltriaux
|
||||
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
|
||||
Contact: michel.peltriaux@sgdnord.rlp.de
|
||||
Created on: 15.11.21
|
||||
|
||||
"""
|
||||
from django.db import models
|
||||
|
||||
from user.enums import UserNotificationEnum
|
||||
|
||||
|
||||
class UserNotification(models.Model):
|
||||
""" Notifications for users
|
||||
|
||||
"""
|
||||
id = models.CharField(
|
||||
max_length=500,
|
||||
null=False,
|
||||
blank=False,
|
||||
choices=UserNotificationEnum.as_choices(drop_empty_choice=True),
|
||||
primary_key=True,
|
||||
)
|
||||
name = models.CharField(
|
||||
max_length=500,
|
||||
null=False,
|
||||
blank=False,
|
||||
unique=True,
|
||||
help_text="Human readable name"
|
||||
)
|
||||
is_active = models.BooleanField(default=True, help_text="Can be toggle to enable/disable this notification for all users")
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
Reference in New Issue
Block a user