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
Commits
6762c3f0
Commit
6762c3f0
authored
10 months ago
by
Jonathan Weth
Browse files
Options
Downloads
Plain Diff
Merge branch '243-add-for_participant-manager' into 'master'
Resolve "Add for_participant manager" Closes
#243
See merge request
!348
parents
093f23f4
0e4ce68d
No related branches found
No related tags found
1 merge request
!348
Resolve "Add for_participant manager"
Pipeline
#184651
failed
10 months ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/chronos/managers.py
+9
-0
9 additions, 0 deletions
aleksis/apps/chronos/managers.py
with
9 additions
and
0 deletions
aleksis/apps/chronos/managers.py
+
9
−
0
View file @
6762c3f0
...
...
@@ -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
(
...
...
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