feat: pwa notifications

This commit is contained in:
2026-07-14 20:49:30 +02:00
parent 2cf7b283e0
commit 5198826f83
21 changed files with 1563 additions and 8 deletions
+23 -3
View File
@@ -1,10 +1,16 @@
from django.contrib import admin
from tracker.models import DoseLog, Medication, PulseReading, ScheduledDose
from tracker.models import (
DoseLog,
Medication,
PulseReading,
ReminderSent,
ScheduledDose,
)
class ScheduledDoseInline(admin.TabularInline):
"""Edit a medication's daily doses right on the medication page."""
"""Edit a medication's daily doses (and their reminder times) on the medication page."""
model = ScheduledDose
extra = 1
@@ -29,10 +35,24 @@ class MedicationAdmin(admin.ModelAdmin):
@admin.register(ScheduledDose)
class ScheduledDoseAdmin(admin.ModelAdmin):
list_display = ["medication", "time_of_day", "amount", "is_active"]
list_display = ["medication", "time_of_day", "amount", "reminder_time", "is_active"]
list_filter = ["is_active", "time_of_day", "medication"]
@admin.register(ReminderSent)
class ReminderSentAdmin(admin.ModelAdmin):
"""Read-only trail of which reminders went out, for when one seems to be missing."""
list_display = ["date", "scheduled_dose", "sent_at"]
list_filter = ["date"]
def has_add_permission(self, request):
return False
def has_change_permission(self, request, obj=None):
return False
@admin.register(DoseLog)
class DoseLogAdmin(admin.ModelAdmin):
"""The history. Day-to-day ticking off happens on the Today page."""