Commit f09c84ec authored by Daniel W Bond's avatar Daniel W Bond
Browse files

created new method, added to dropdown

parent 5d3b7e43
......@@ -10,6 +10,7 @@
# Django Imports
from django.contrib import admin
from django.contrib.gis.admin import OSMGeoAdmin
from django.shortcuts import render
# App Imports
from .models import Facility, Schedule, OpenTime, Category, Location, Alert
......@@ -26,7 +27,15 @@ class FacilityAdmin(admin.ModelAdmin):
self.message_user(request, "Successfully removed special schedules from %d facilities." % num)
actions = [drop_special_schedules, ]
def assign_bulk_schedules(self, request, queryset):
return render(request,
context = {'facilities': queryset,
'schedules': Schedule.objects.all()})
assign_bulk_schedules.short_description = 'Assign a schedule to multiple facilities'
# a list of all actions to be added
actions = [drop_special_schedules, assign_bulk_schedules, ]
# Allow filtering by the following fields
list_filter = ['facility_category', 'facility_location']
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment