Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
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
Container Registry
Model registry
Operate
Environments
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®
Official
AlekSIS-App-Alsijil
Commits
7fbbec18
Verified
Commit
7fbbec18
authored
5 years ago
by
mirabilos
Committed by
mirabilos
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fetch the lesson_period eagerly, too.
parent
99bb48f9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
biscuit/apps/alsijil/views.py
+5
-2
5 additions, 2 deletions
biscuit/apps/alsijil/views.py
with
5 additions
and
2 deletions
biscuit/apps/alsijil/views.py
+
5
−
2
View file @
7fbbec18
...
...
@@ -96,8 +96,11 @@ def group_week(request: HttpRequest, week: Optional[int] = None) -> HttpResponse
periods_by_day_unsorted
=
{}
if
group
:
for
act_group
in
[
group
]
+
list
(
group
.
child_groups
.
all
()):
for
lesson
in
act_group
.
lessons
.
filter
(
date_start__lte
=
week_start
,
date_end__gte
=
week_end
):
for
lesson_period
in
lesson
.
lesson_periods
.
select_related
(
'
period
'
).
all
():
for
lesson
in
act_group
.
lessons
.
select_related
(
'
lesson_period
'
,
'
lesson_period__period
'
).
filter
(
date_start__lte
=
week_start
,
date_end__gte
=
week_end
):
for
lesson_period
in
lesson
.
lesson_periods
.
all
():
periods_by_day_unsorted
.
setdefault
(
lesson_period
.
period
.
weekday
,
[]).
append
(
lesson_period
)
...
...
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