From eef04d0672eb8d84767264df94a4052971852b1c Mon Sep 17 00:00:00 2001 From: morganog Date: Tue, 3 Sep 2024 19:16:31 -0500 Subject: [PATCH] ticket #16 Partial add to: Remainders --- settings/admin.py | 12 ++++++++++++ settings/models.py | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/settings/admin.py b/settings/admin.py index 2677a96..1d851eb 100644 --- a/settings/admin.py +++ b/settings/admin.py @@ -1,10 +1,13 @@ from django.contrib import admin +from django.http.request import HttpRequest from crm.site.crmadminsite import crm_site from settings.models import BannedCompanyName from settings.models import PublicEmailDomain from settings.models import StopPhrase +from models import Reminders + class BannedCompanyNameAdmin(admin.ModelAdmin): list_display = ('name',) @@ -28,3 +31,12 @@ class StopPhraseAdmin(admin.ModelAdmin): admin.site.register(BannedCompanyName, BannedCompanyNameAdmin) admin.site.register(PublicEmailDomain, PublicEmailDomainAdmin) admin.site.register(StopPhrase, StopPhraseAdmin) + +class RemindersAdmin(admin.ModelAdmin): + def has_add_permission(self, request: HttpRequest) -> bool: + return False + + def has_delete_permission(self, request: HttpRequest, obj: Any | None = ...) -> bool: + return False + +admin.site.register(Reminders, RemindersAdmin) diff --git a/settings/models.py b/settings/models.py index 66ea7e5..442f08a 100644 --- a/settings/models.py +++ b/settings/models.py @@ -57,3 +57,9 @@ def hit(self): def __str__(self): return self.phrase + +class Reminders(models.Model): + setting_value = models.PositiveBigIntegerField() + + def __str__(self): + return f"Reminder {self.setting_value}"