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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Blanke
AKPlanning
Commits
a4ab46ff
Commit
a4ab46ff
authored
4 months ago
by
Felix Blanke
Browse files
Options
Downloads
Patches
Plain Diff
Sort export lists to make dict eq test reliable
parent
48cb609e
No related branches found
No related tags found
1 merge request
!20
Check data consistency at import
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
AKModel/models.py
+12
-6
12 additions, 6 deletions
AKModel/models.py
with
12 additions
and
6 deletions
AKModel/models.py
+
12
−
6
View file @
a4ab46ff
...
...
@@ -536,8 +536,8 @@ class Event(models.Model):
"
blocks
"
:
[],
}
rooms
=
Room
.
objects
.
filter
(
event
=
self
)
slots
=
AKSlot
.
objects
.
filter
(
event
=
self
)
rooms
=
Room
.
objects
.
filter
(
event
=
self
)
.
order_by
()
slots
=
AKSlot
.
objects
.
filter
(
event
=
self
)
.
order_by
()
ak_availabilities
=
{
ak
.
pk
:
Availability
.
union
(
ak
.
availabilities
.
all
())
...
...
@@ -614,7 +614,7 @@ class Event(models.Model):
"
start
"
:
timeslot
.
avail
.
start
.
astimezone
(
self
.
timezone
).
strftime
(
"
%Y-%m-%d %H:%M
"
),
"
end
"
:
timeslot
.
avail
.
end
.
astimezone
(
self
.
timezone
).
strftime
(
"
%Y-%m-%d %H:%M
"
),
},
"
fulfilled_time_constraints
"
:
time_constraints
,
"
fulfilled_time_constraints
"
:
sorted
(
time_constraints
)
,
})
timeslots
[
"
blocks
"
].
append
(
current_block
)
...
...
@@ -1038,6 +1038,7 @@ class Room(models.Model):
if
not
any
(
constr
.
startswith
(
"
proxy
"
)
for
constr
in
data
[
"
fulfilled_room_constraints
"
]):
data
[
"
fulfilled_room_constraints
"
].
append
(
"
no-proxy
"
)
data
[
"
fulfilled_room_constraints
"
].
sort
()
return
data
...
...
@@ -1174,9 +1175,11 @@ class AKSlot(models.Model):
"
duration
"
:
math
.
ceil
(
self
.
duration
/
self
.
event
.
export_slot
-
ceil_offet_eps
),
"
properties
"
:
{
"
conflicts
"
:
sorted
(
[
conflict
.
pk
for
conflict
in
conflict_slots
.
all
()]
+
[
second_slot
.
pk
for
second_slot
in
other_ak_slots
.
all
()],
"
dependencies
"
:
[
dep
.
pk
for
dep
in
dependency_slots
.
all
()],
+
[
second_slot
.
pk
for
second_slot
in
other_ak_slots
.
all
()]
),
"
dependencies
"
:
sorted
([
dep
.
pk
for
dep
in
dependency_slots
.
all
()]),
},
"
room_constraints
"
:
[
constraint
.
name
for
constraint
in
self
.
ak
.
requirements
.
all
()],
...
...
@@ -1206,6 +1209,9 @@ class AKSlot(models.Model):
if
not
any
(
constr
.
startswith
(
"
proxy
"
)
for
constr
in
data
[
"
room_constraints
"
]):
data
[
"
room_constraints
"
].
append
(
"
no-proxy
"
)
data
[
"
room_constraints
"
].
sort
()
data
[
"
time_constraints
"
].
sort
()
return
data
class
AKOrgaMessage
(
models
.
Model
):
...
...
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