Code source de geonature.core.notifications.admin

from flask_admin.contrib.sqla import ModelView

from geonature.utils.env import DB
from geonature.core.admin.utils import CruvedProtectedMixin
from geonature.core.notifications.models import NotificationCategory


[docs] class NotificationTemplateAdmin(CruvedProtectedMixin, ModelView):
[docs] module_code = "ADMIN"
[docs] object_code = "NOTIFICATIONS"
[docs] column_list = ("code_category", "code_method", "content")
[docs] column_labels = { "code_category": "Catégorie", "code_method": "Méthode d'envoi", "content": "Contenu du template de notification", }
[docs] form_columns = ("category", "method", "content")
[docs] form_args = { "category": {"label": "Catégorie", "get_label": "display"}, "method": {"label": "Methode d'envoi", "get_label": "display"}, "content": {"label": "Contenu de la notification"}, }
[docs] class NotificationCategoryAdmin(CruvedProtectedMixin, ModelView):
[docs] module_code = "ADMIN"
[docs] object_code = "NOTIFICATIONS"
[docs] column_list = ("code", "label", "description")
[docs] form_columns = ("code", "label", "description")
[docs] form_args = { "code": {"description": "Identifiant de la catégorie de notification"}, "label": {"description": "Titre affiché dans la notification"}, }
[docs] class NotificationMethodAdmin(CruvedProtectedMixin, ModelView):
[docs] module_code = "ADMIN"
[docs] object_code = "NOTIFICATIONS"
[docs] column_list = ("code", "label", "description")
[docs] form_columns = ("code", "label", "description")
[docs] form_args = { "code": {"description": "Identifiant de la méthode de notification"}, }