Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open
Commits
1672d971
Commit
1672d971
authored
Jan 26, 2019
by
David Haynes
🙆
Browse files
Allow for n amount of open times
Closes
#90
parent
971736fe
Pipeline
#3728
passed with stage
in 1 minute and 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
whats-open/api/admin.py
View file @
1672d971
...
...
@@ -145,7 +145,7 @@ class FacilityAdmin(admin.ModelAdmin):
return
initial_data
class
OpenTimeInline
(
admin
.
Tabular
Inline
):
class
OpenTimeInline
(
admin
.
Stacked
Inline
):
"""
A table of time periods that represent an "open time" for a Facility.
...
...
@@ -154,9 +154,7 @@ class OpenTimeInline(admin.TabularInline):
# Columns correspond to each attribute in the OpenTime table
model
=
OpenTime
# 7 days of the week, so only have 7 rows
max_num
=
7
extra
=
7
extra
=
1
# We are basically reordering things to look nicer to the user here
fieldsets
=
(
(
None
,
{
"fields"
:
((
"start_day"
,
"start_time"
),
(
"end_day"
,
"end_time"
))}),
...
...
@@ -184,8 +182,7 @@ class ScheduleAdmin(admin.ModelAdmin):
{
"fields"
:
(
"name"
,
# Pair valid_start and valid_end together on the same
# line
# Pair valid_start and valid_end together on the same line
(
"valid_start"
,
"valid_end"
),
"twenty_four_hours"
,
"schedule_for_removal"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment