Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AKPlanning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Blanke
AKPlanning
Commits
bb1179c7
Commit
bb1179c7
authored
4 months ago
by
Lorenzo Conti
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/duration-rounding-strategy' into 'main'
Rounding strategy for slot duration at JSON export Closes
#16
See merge request
!6
parents
e0801c1f
9301ef7a
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!17
Add view to clear schedule
,
!6
Rounding strategy for slot duration at JSON export
Pipeline
#269213
passed
4 months ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
AKModel/models.py
+6
-1
6 additions, 1 deletion
AKModel/models.py
with
6 additions
and
1 deletion
AKModel/models.py
+
6
−
1
View file @
bb1179c7
import
decimal
import
itertools
import
json
import
math
from
dataclasses
import
dataclass
from
datetime
import
datetime
,
timedelta
from
typing
import
Iterable
,
Generator
...
...
@@ -951,10 +953,12 @@ class AKSlot(models.Model):
return
[]
return
[
f
"
availability-person-
{
owner
.
pk
}
"
]
ceil_offet_eps
=
decimal
.
Decimal
(
1e-4
)
# self.slots_in_an_hour is set in AKJSONExportView
data
=
{
"
id
"
:
str
(
self
.
pk
),
"
duration
"
:
round
(
self
.
duration
*
self
.
slots_in_an_hour
),
"
duration
"
:
math
.
ceil
(
self
.
duration
*
self
.
slots_in_an_hour
-
ceil_offet_eps
),
"
properties
"
:
{},
"
room_constraints
"
:
[
constraint
.
name
for
constraint
in
self
.
ak
.
requirements
.
all
()],
...
...
@@ -965,6 +969,7 @@ class AKSlot(models.Model):
for
owner
in
self
.
ak
.
owners
.
all
()]),
"
description
"
:
self
.
ak
.
description
,
"
reso
"
:
self
.
ak
.
reso
,
"
duration_in_hours
"
:
float
(
self
.
duration
),
},
}
...
...
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