From d1b09797bfeecf833ca6ad758489ca2b8f8b8eb8 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Tue, 3 Feb 2026 14:40:27 -0300 Subject: [PATCH] Add admin interfaces for ScheduleProfile, ScheduleSlot, and PeerScheduling models --- scheduler/admin.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/scheduler/admin.py b/scheduler/admin.py index 846f6b4..fbd24f7 100644 --- a/scheduler/admin.py +++ b/scheduler/admin.py @@ -1 +1,28 @@ -# Register your models here. +from django.contrib import admin + +from .models import PeerScheduling, ScheduleSlot, ScheduleProfile + + +class ScheduleProfileAdmin(admin.ModelAdmin): + list_display = ('name', 'created', 'updated') + search_fields = ('name',) + ordering = ('name', 'created') +admin.site.register(ScheduleProfile, ScheduleProfileAdmin) + + +class ScheduleSlotAdmin(admin.ModelAdmin): + list_display = ('profile', 'start_weekday', 'end_weekday', 'start_time', 'end_time', 'created', 'updated') + list_filter = ('profile', 'start_weekday', 'end_weekday', 'created', 'updated') + search_fields = ('profile__name',) + ordering = ('profile__name', 'start_weekday', 'start_time') +admin.site.register(ScheduleSlot, ScheduleSlotAdmin) + + +class PeerSchedulingAdmin(admin.ModelAdmin): + list_display = ('peer', 'profile', 'next_scheduled_enable_at', 'next_scheduled_disable_at', + 'next_manual_suspend_at', 'next_manual_unsuspend_at', 'created', 'updated') + list_filter = ('profile', 'created', 'updated') + search_fields = ('peer__name', 'manual_suspend_reason') + ordering = ('created', 'updated') +admin.site.register(PeerScheduling, PeerSchedulingAdmin) +