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
3058fc83
Commit
3058fc83
authored
Nov 01, 2016
by
Daniel W Bond
Browse files
added dates to integers-- integerfield now has choices from 0-6
parent
51cce9cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
whats_open/website/models.py
View file @
3058fc83
...
...
@@ -90,10 +90,29 @@ class Schedule(BaseModel):
class
OpenTime
(
BaseModel
):
"""Represents a period time when a Facility is open"""
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
(
)
# 0-6, Monday == 0
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