Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Lesrooster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Onboarding
AlekSIS-App-Lesrooster
Commits
de33dc2d
Verified
Commit
de33dc2d
authored
3 months ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Update timetable printing for lesson bundles
parent
c9c874ce
No related branches found
Branches containing commit
No related tags found
1 merge request
!36
Resolve "[New data model] PDF export for "regular" timetable"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/lesrooster/managers.py
+2
-1
2 additions, 1 deletion
aleksis/apps/lesrooster/managers.py
aleksis/apps/lesrooster/util/build.py
+5
-5
5 additions, 5 deletions
aleksis/apps/lesrooster/util/build.py
with
7 additions
and
6 deletions
aleksis/apps/lesrooster/managers.py
+
2
−
1
View file @
de33dc2d
from
collections.abc
import
Iterable
from
datetime
import
time
from
typing
import
Iterable
,
Optional
,
Union
from
typing
import
Optional
,
Union
from
django.db.models
import
Max
,
Min
,
Q
,
QuerySet
from
django.db.models.functions
import
Coalesce
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/lesrooster/util/build.py
+
5
−
5
View file @
de33dc2d
...
...
@@ -25,11 +25,13 @@ def build_timetable(
max_slots
=
len
(
max_slots
)
# Get matching lessons
lessons
=
Lesson
.
objects
.
filter
(
slot_start__time_grid
=
time_grid
).
filter_from_type
(
type_
,
obj
)
lessons
=
Lesson
.
objects
.
filter
(
bundle__slot_start__time_grid
=
time_grid
).
filter_from_type
(
type_
,
obj
)
# Sort lesson periods in a dict
for
lesson
in
lessons
:
lesson_periods_per_slot
[
lesson
.
slot_start
].
append
(
lesson
)
lesson_periods_per_slot
[
lesson
.
bundle
.
all
()[
0
].
slot_start
].
append
(
lesson
)
# Get matching supervisions
supervisions
=
Supervision
.
objects
.
filter
(
break_slot__time_grid
=
time_grid
).
filter_from_type
(
...
...
@@ -65,9 +67,7 @@ def build_timetable(
col
=
{
"
type
"
:
"
period
"
,
"
col
"
:
(
lesson_periods_per_slot
[
actual_slot
]
if
actual_slot
in
lesson_periods_per_slot
else
[]
lesson_periods_per_slot
.
get
(
actual_slot
,
[])
),
}
...
...
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