feat: pwa notifications
This commit is contained in:
+23
-3
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user