Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
whats-open
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jay J Kim
whats-open
Commits
c8b2b9ba
Commit
c8b2b9ba
authored
Dec 09, 2013
by
Renfred Harper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort schedules by open_time
parent
7109b57e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
website/api.py
website/api.py
+7
-2
No files found.
website/api.py
View file @
c8b2b9ba
...
...
@@ -16,7 +16,10 @@ def export_data():
'id'
:
restaurant
.
id
}
open_times
=
list
()
for
time
in
restaurant
.
main_schedule
.
open_times
.
all
():
# Sort open times by their start day and time
sorted_times
=
sorted
(
restaurant
.
main_schedule
.
open_times
.
all
(),
key
=
lambda
t
:
(
t
.
start_day
,
t
.
start_time
,
t
.
end_time
))
for
time
in
sorted_times
:
open_times
.
append
({
'start_day'
:
time
.
start_day
,
'start_time'
:
time
.
start_time
.
isoformat
(),
...
...
@@ -30,7 +33,9 @@ def export_data():
special_schedules
=
list
()
for
schedule
in
restaurant
.
special_schedules
.
all
():
open_times
=
list
()
for
time
in
schedule
.
open_times
.
all
():
sorted_times
=
sorted
(
schedule
.
open_times
.
all
(),
key
=
lambda
t
:
(
t
.
start_day
,
t
.
start_time
,
t
.
end_time
))
for
time
in
sorted_times
:
open_times
.
append
({
'start_day'
:
time
.
start_day
,
'start_time'
:
time
.
start_time
.
isoformat
(),
...
...
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