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
e89558a7
Commit
e89558a7
authored
5 years ago
by
Tom Teichler
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into 58-models-for-advanced-features-from-schoolapps-imported-from-untis
parents
6b42a024
8cbb193c
No related branches found
No related tags found
1 merge request
!39
Resolve "Models for advanced features from SchoolApps (imported from Untis)"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/chronos/models.py
+7
-2
7 additions, 2 deletions
aleksis/apps/chronos/models.py
with
7 additions
and
2 deletions
aleksis/apps/chronos/models.py
+
7
−
2
View file @
e89558a7
...
@@ -255,12 +255,17 @@ class LessonSubstitutionQuerySet(LessonDataQuerySet):
...
@@ -255,12 +255,17 @@ class LessonSubstitutionQuerySet(LessonDataQuerySet):
def
affected_teachers
(
self
):
def
affected_teachers
(
self
):
"""
Return all teachers which are affected by selected substitutions (as substituted or substituting)
"""
"""
Return all teachers which are affected by selected substitutions (as substituted or substituting)
"""
return
Person
.
objects
.
filter
(
Q
(
lessons_as_teacher__in
=
self
.
affected_lessons
())
|
Q
(
lesson_substitutions__in
=
self
))
return
Person
.
objects
.
filter
(
Q
(
lessons_as_teacher__in
=
self
.
affected_lessons
())
|
Q
(
lesson_substitutions__in
=
self
)
).
annotate
(
lessons_count
=
Count
(
"
lessons_as_teacher
"
))
def
affected_groups
(
self
):
def
affected_groups
(
self
):
"""
Return all groups which are affected by selected substitutions
"""
"""
Return all groups which are affected by selected substitutions
"""
return
Group
.
objects
.
filter
(
lessons__in
=
self
.
affected_lessons
())
return
Group
.
objects
.
filter
(
lessons__in
=
self
.
affected_lessons
()).
annotate
(
lessons_count
=
Count
(
"
lessons
"
)
)
class
TimePeriod
(
models
.
Model
):
class
TimePeriod
(
models
.
Model
):
...
...
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