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
8d89bf54
Commit
8d89bf54
authored
5 months ago
by
permcu
Browse files
Options
Downloads
Patches
Plain Diff
Fix annotate_person_statistics_from_documentations
parent
c3f5cf28
No related branches found
No related tags found
1 merge request
!422
Resolve "Add export functionality to course book"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/model_extensions.py
+6
-3
6 additions, 3 deletions
aleksis/apps/alsijil/model_extensions.py
aleksis/apps/alsijil/tasks.py
+1
-1
1 addition, 1 deletion
aleksis/apps/alsijil/tasks.py
with
7 additions
and
4 deletions
aleksis/apps/alsijil/model_extensions.py
+
6
−
3
View file @
8d89bf54
...
...
@@ -93,9 +93,12 @@ def annotate_person_statistics(
return
persons
def
annotate_person_statistics_from_documentations
(
docs
:
QuerySet
[
Documentation
])
->
QuerySet
[
Person
]:
def
annotate_person_statistics_from_documentations
(
persons
:
QuerySet
[
Person
],
docs
:
QuerySet
[
Documentation
]
)
->
QuerySet
[
Person
]:
"""
Annotate a queryset of persons with class register statistics from queryset of documentations.
"""
docs
=
list
(
doc
umentation
s
.
values_list
(
"
pk
"
,
flat
=
True
))
docs
=
list
(
docs
.
values_list
(
"
pk
"
,
flat
=
True
))
return
annotate_person_statistics
(
persons
,
Q
(
participations__related_documentation__in
=
docs
),
...
...
@@ -113,4 +116,4 @@ def annotate_person_statistics_for_school_term(
)
if
group
:
documentations
.
filter
(
Q
(
course__groups
=
group
)
|
Q
(
course__groups__parent_groups
=
group
))
return
annotate_person_statistics_from_documentations
(
documentations
)
return
annotate_person_statistics_from_documentations
(
persons
,
documentations
)
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/tasks.py
+
1
−
1
View file @
8d89bf54
...
...
@@ -98,7 +98,7 @@ def generate_full_register_printout(
)
if
include_members_table
or
include_person_overviews
:
context
[
"
members
"
]
=
annotate_person_statistics_from_documentations
(
documentations
)
context
[
"
members
"
]
=
annotate_person_statistics_from_documentations
(
group
.
members
.
all
(),
documentations
)
if
include_person_overviews
:
doc_query_set
=
Documentation
.
objects
.
select_related
(
"
subject
"
).
prefetch_related
(
"
teachers
"
),
...
...
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