Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Chronos
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-Chronos
Merge requests
!348
Resolve "Add for_participant manager"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Add for_participant manager"
243-add-for_participant-manager
into
master
Overview
2
Commits
1
Pipelines
3
Changes
1
All threads resolved!
Hide all comments
Merged
permcu
requested to merge
243-add-for_participant-manager
into
master
10 months ago
Overview
2
Commits
1
Pipelines
3
Changes
1
All threads resolved!
Hide all comments
Expand
Closes
#243 (closed)
0
0
Merge request reports
Compare
master
version 1
be8e9c5c
10 months ago
master (base)
and
latest version
latest version
0e4ce68d
1 commit,
10 months ago
version 1
be8e9c5c
1 commit,
10 months ago
1 file
+
9
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
aleksis/apps/chronos/managers.py
+
9
−
0
Options
@@ -876,6 +876,15 @@ class LessonEventQuerySet(PolymorphicQuerySet):
)
return
self
.
filter
(
Q
(
teachers
=
teacher
)
|
Q
(
pk__in
=
amended
)).
distinct
()
def
for_participant
(
self
,
person
:
Union
[
int
,
Person
])
->
"
LessonEventQuerySet
"
:
"""
Get all lesson events the person participates in (including amends).
"""
amended
=
self
.
filter
(
Q
(
amended_by__isnull
=
False
)
|
Q
(
groups__members
=
person
)
).
values_list
(
"
amended_by__pk
"
,
flat
=
True
)
return
self
.
filter
(
Q
(
groups__members
=
person
)
|
Q
(
pk__in
=
amended
)
).
distinct
()
def
for_group
(
self
,
group
:
Union
[
int
,
Group
])
->
"
LessonEventQuerySet
"
:
"""
Get all lesson events for a certain group (including amends/as parent group).
"""
amended
=
self
.
filter
(
Loading