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
fd135214
Commit
fd135214
authored
Mar 22, 2017
by
Daniel W Bond
Browse files
fixed merge conflict
parents
e6d094bc
3058fc83
Changes
1
Hide whitespace changes
Inline
Side-by-side
whats_open/website/models.py
View file @
fd135214
...
...
@@ -90,10 +90,29 @@ class Schedule(BaseModel):
class
OpenTime
(
BaseModel
):
"""Represents a period time when a Facility is open"""
open_time_schedule
=
models
.
ForeignKey
(
'Schedule'
,
related_name
=
'open_times'
)
start_day
=
models
.
IntegerField
()
# 0-6, Monday == 0
MONDAY
=
0
TUESDAY
=
1
WEDNESDAY
=
2
THURSDAY
=
3
FRIDAY
=
4
SATURDAY
=
5
SUNDAY
=
6
DAY_CHOICES
=
(
(
MONDAY
,
'Monday'
),
(
TUESDAY
,
'Tuesday'
),
(
WEDNESDAY
,
'Wednesday'
),
(
THURSDAY
,
'Thursday'
),
(
FRIDAY
,
'Friday'
),
(
SATURDAY
,
'Saturday'
),
(
SUNDAY
,
'Sunday'
),
)
schedule
=
models
.
ForeignKey
(
'Schedule'
,
related_name
=
'open_times'
)
start_day
=
models
.
IntegerField
(
default
=
0
,
choices
=
DAY_CHOICES
)
start_time
=
models
.
TimeField
()
end_day
=
models
.
IntegerField
(
)
# 0-6, Monday == 0
end_day
=
models
.
IntegerField
(
default
=
0
,
choices
=
DAY_CHOICES
)
end_time
=
models
.
TimeField
()
def
isOpenNow
(
self
):
...
...
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