Commit 17379e27 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

Merge branch 'adminning' into upgrade-django

parents 1f86cea3 34a5bab2
......@@ -4,15 +4,36 @@ from .models import Facility, Schedule, OpenTime, Category
class OpenTimeInline(admin.TabularInline):
model = OpenTime
fk_name = 'schedule'
max_num = 7
class OpenTimeAdmin(admin.ModelAdmin):
pass
class FacilityAdmin(admin.ModelAdmin):
pass
model = Facility
list_display = ['name', 'location' ]
list_filter = ['facility_category', ]
fieldsets = (
(None, {
'fields': ('name', 'facility_category',
('location', 'on_campus'),
'main_schedule', 'special_schedules', ),
}),
('Advanced', {
'fields': ('owners', ),
'classes': ('collapse', ),
}),
)
class ScheduleAdmin(admin.ModelAdmin):
list_display = ['name', 'modified']
inlines = [OpenTimeInline, ]
fieldsets = (
(None, {
'fields': ('name',
('valid_start', 'valid_end'),)
}),
)
class CategoryAdmin(admin.ModelAdmin):
pass
......
......@@ -29,7 +29,8 @@ class Facility(TimeStampedModel):
main_schedule = models.ForeignKey('Schedule',
related_name='facility_main')
special_schedules = models.ManyToManyField('Schedule',
related_name='facility_special', blank=True)
related_name='facility_special', blank=True,
help_text='This schedule will come into effect only for its specified duration.')
class Meta:
verbose_name = "facility"
......
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