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
97409afa
Verified
Commit
97409afa
authored
4 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Use CurrentSiteManager
Closes
#80
parent
1484f485
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/chronos/managers.py
+3
-2
3 additions, 2 deletions
aleksis/apps/chronos/managers.py
aleksis/apps/chronos/models.py
+6
-5
6 additions, 5 deletions
aleksis/apps/chronos/models.py
with
9 additions
and
7 deletions
aleksis/apps/chronos/managers.py
+
3
−
2
View file @
97409afa
...
...
@@ -2,6 +2,7 @@ from datetime import date, datetime, timedelta
from
enum
import
Enum
from
typing
import
Optional
,
Union
from
django.contrib.sites.managers
import
CurrentSiteManager
from
django.db
import
models
from
django.db.models
import
Count
,
F
,
Q
...
...
@@ -26,7 +27,7 @@ class TimetableType(Enum):
return
cls
.
__members__
.
get
(
s
.
upper
())
class
LessonPeriodManager
(
models
.
Manager
):
class
LessonPeriodManager
(
CurrentSite
Manager
):
"""
Manager adding specific methods to lesson periods.
"""
def
get_queryset
(
self
):
...
...
@@ -40,7 +41,7 @@ class LessonPeriodManager(models.Manager):
)
class
LessonSubstitutionManager
(
models
.
Manager
):
class
LessonSubstitutionManager
(
CurrentSite
Manager
):
"""
Manager adding specific methods to lesson substitutions.
"""
def
get_queryset
(
self
):
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/chronos/models.py
+
6
−
5
View file @
97409afa
...
...
@@ -3,6 +3,7 @@ from __future__ import annotations
from
datetime
import
date
,
datetime
,
time
,
timedelta
from
typing
import
Dict
,
Optional
,
Tuple
,
Union
from
django.contrib.sites.managers
import
CurrentSiteManager
from
django.core.exceptions
import
ValidationError
from
django.db
import
models
from
django.db.models
import
Max
,
Min
,
Q
...
...
@@ -388,7 +389,7 @@ class AbsenceReason(ExtensibleModel):
class
Absence
(
ExtensibleModel
):
objects
=
models
.
Manager
.
from_queryset
(
AbsenceQuerySet
)()
objects
=
CurrentSite
Manager
.
from_queryset
(
AbsenceQuerySet
)()
reason
=
models
.
ForeignKey
(
"
AbsenceReason
"
,
...
...
@@ -491,7 +492,7 @@ class Exam(ExtensibleModel):
class
Holiday
(
ExtensibleModel
):
objects
=
models
.
Manager
.
from_queryset
(
HolidayQuerySet
)()
objects
=
CurrentSite
Manager
.
from_queryset
(
HolidayQuerySet
)()
title
=
models
.
CharField
(
verbose_name
=
_
(
"
Title
"
),
max_length
=
255
)
date_start
=
models
.
DateField
(
verbose_name
=
_
(
"
Start date
"
),
null
=
True
)
...
...
@@ -603,7 +604,7 @@ class Break(ExtensibleModel):
class
Supervision
(
ExtensibleModel
):
objects
=
models
.
Manager
.
from_queryset
(
SupervisionQuerySet
)()
objects
=
CurrentSite
Manager
.
from_queryset
(
SupervisionQuerySet
)()
area
=
models
.
ForeignKey
(
SupervisionArea
,
...
...
@@ -671,7 +672,7 @@ class SupervisionSubstitution(ExtensibleModel):
class
Event
(
ExtensibleModel
,
GroupPropertiesMixin
,
TeacherPropertiesMixin
):
label_
=
"
event
"
objects
=
models
.
Manager
.
from_queryset
(
EventQuerySet
)()
objects
=
CurrentSite
Manager
.
from_queryset
(
EventQuerySet
)()
title
=
models
.
CharField
(
verbose_name
=
_
(
"
Title
"
),
max_length
=
255
,
blank
=
True
)
...
...
@@ -726,7 +727,7 @@ class Event(ExtensibleModel, GroupPropertiesMixin, TeacherPropertiesMixin):
class
ExtraLesson
(
ExtensibleModel
,
GroupPropertiesMixin
):
label_
=
"
extra_lesson
"
objects
=
models
.
Manager
.
from_queryset
(
ExtraLessonQuerySet
)()
objects
=
CurrentSite
Manager
.
from_queryset
(
ExtraLessonQuerySet
)()
week
=
models
.
IntegerField
(
verbose_name
=
_
(
"
Week
"
),
default
=
CalendarWeek
.
current_week
)
period
=
models
.
ForeignKey
(
...
...
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