Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
ViaResto-website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aymeric Chaumont
ViaResto-website
Commits
5e732180
Commit
5e732180
authored
Jul 11, 2022
by
Aymeric Chaumont
Browse files
Options
Downloads
Plain Diff
conflicts
parents
928b2238
00d9b2c9
No related branches found
No related tags found
2 merge requests
!29
Time dependence
,
!28
improve front
Pipeline
#43932
passed with warnings
Jul 11, 2022
Stage: build
Stage: test
This commit is part of merge request
!28
. Comments created here will be created in the context of that merge request.
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/db/crud.py
+9
-0
9 additions, 0 deletions
backend/db/crud.py
backend/db/models.py
+5
-1
5 additions, 1 deletion
backend/db/models.py
with
14 additions
and
1 deletion
backend/db/crud.py
+
9
−
0
Edit
View file @
5e732180
...
@@ -13,8 +13,13 @@ from db import models, schemas
...
@@ -13,8 +13,13 @@ from db import models, schemas
def
get_waiting_time
(
place
:
str
,
db
:
Session
):
def
get_waiting_time
(
place
:
str
,
db
:
Session
):
"""
Get the last estimated waiting time for the given place
"""
"""
Get the last estimated waiting time for the given place
"""
<<<<<<<
HEAD
current_date
=
datetime
.
now
(
tz
=
pytz
.
timezone
(
"
Europe/Paris
"
))
current_date
=
datetime
.
now
(
tz
=
pytz
.
timezone
(
"
Europe/Paris
"
))
weekday
,
current_time
=
current_date
.
weekday
(),
date
.
time
()
weekday
,
current_time
=
current_date
.
weekday
(),
date
.
time
()
=======
date
=
datetime
.
now
(
tz
=
pytz
.
timezone
(
"
Europe/Paris
"
))
weekday
,
current_time
=
date
.
weekday
(),
date
.
time
()
>>>>>>>
00
d9b2c9fa55c3e0926b456eb76b17b94ad9d45a
first_timeslot
=
get_timeslot
(
place
,
weekday
,
True
,
db
)
first_timeslot
=
get_timeslot
(
place
,
weekday
,
True
,
db
)
if
first_timeslot
and
current_time
<
first_timeslot
[
0
]:
if
first_timeslot
and
current_time
<
first_timeslot
[
0
]:
return
first_timeslot
[
0
].
hour
,
first_timeslot
[
0
].
minute
return
first_timeslot
[
0
].
hour
,
first_timeslot
[
0
].
minute
...
@@ -44,7 +49,11 @@ def get_waiting_time(place: str, db: Session):
...
@@ -44,7 +49,11 @@ def get_waiting_time(place: str, db: Session):
return
None
,
None
return
None
,
None
<<<<<<<
HEAD
def
get_avg_graph_points
(
place
:
str
,
weekday
:
int
,
min_time
:
time
,
max_time
:
time
,
interval
:
timedelta
,
db
:
Session
):
def
get_avg_graph_points
(
place
:
str
,
weekday
:
int
,
min_time
:
time
,
max_time
:
time
,
interval
:
timedelta
,
db
:
Session
):
=======
def
get_stats
(
place
:
str
,
weekday
:
int
,
min_time
:
time
,
max_time
:
time
,
interval
:
timedelta
,
db
:
Session
):
>>>>>>>
00
d9b2c9fa55c3e0926b456eb76b17b94ad9d45a
"""
Get the average waiting time for each interval between two time steps
"""
"""
Get the average waiting time for each interval between two time steps
"""
def
shift_time
(
t
:
time
,
delta
:
timedelta
):
def
shift_time
(
t
:
time
,
delta
:
timedelta
):
...
...
This diff is collapsed.
Click to expand it.
backend/db/models.py
+
5
−
1
Edit
View file @
5e732180
...
@@ -48,4 +48,8 @@ class OpeningHours(Base):
...
@@ -48,4 +48,8 @@ class OpeningHours(Base):
day
=
Column
(
Integer
)
day
=
Column
(
Integer
)
timeslot
=
Column
(
Boolean
)
timeslot
=
Column
(
Boolean
)
open_time
=
Column
(
Time
)
open_time
=
Column
(
Time
)
<<<<<<<
HEAD
close_time
=
Column
(
Time
)
close_time
=
Column
(
Time
)
=======
close_time
=
Column
(
Time
)
>>>>>>>
00
d9b2c9fa55c3e0926b456eb76b17b94ad9d45a
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment