Commit 1672d971 authored by David Haynes's avatar David Haynes 🙆

Allow for n amount of open times

Closes #90
parent 971736fe
Pipeline #3728 passed with stage
in 1 minute and 8 seconds
...@@ -145,7 +145,7 @@ class FacilityAdmin(admin.ModelAdmin): ...@@ -145,7 +145,7 @@ class FacilityAdmin(admin.ModelAdmin):
return initial_data return initial_data
class OpenTimeInline(admin.TabularInline): class OpenTimeInline(admin.StackedInline):
""" """
A table of time periods that represent an "open time" for a Facility. A table of time periods that represent an "open time" for a Facility.
...@@ -154,9 +154,7 @@ class OpenTimeInline(admin.TabularInline): ...@@ -154,9 +154,7 @@ class OpenTimeInline(admin.TabularInline):
# Columns correspond to each attribute in the OpenTime table # Columns correspond to each attribute in the OpenTime table
model = OpenTime model = OpenTime
# 7 days of the week, so only have 7 rows extra = 1
max_num = 7
extra = 7
# We are basically reordering things to look nicer to the user here # We are basically reordering things to look nicer to the user here
fieldsets = ( fieldsets = (
(None, {"fields": (("start_day", "start_time"), ("end_day", "end_time"))}), (None, {"fields": (("start_day", "start_time"), ("end_day", "end_time"))}),
...@@ -184,8 +182,7 @@ class ScheduleAdmin(admin.ModelAdmin): ...@@ -184,8 +182,7 @@ class ScheduleAdmin(admin.ModelAdmin):
{ {
"fields": ( "fields": (
"name", "name",
# Pair valid_start and valid_end together on the same # Pair valid_start and valid_end together on the same line
# line
("valid_start", "valid_end"), ("valid_start", "valid_end"),
"twenty_four_hours", "twenty_four_hours",
"schedule_for_removal", "schedule_for_removal",
......
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