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
!9
WIP: Add way to edit substitution
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
WIP: Add way to edit substitution
issue12
into
master
Overview
0
Commits
19
Pipelines
0
Changes
1
Merged
Tom Teichler
requested to merge
issue12
into
master
5 years ago
Overview
0
Commits
19
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
7746a954
Prev
Next
Show latest version
1 file
+
9
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
7746a954
Resolve circular dependency of code in tables.py by using annotations from Python 4.0.
· 7746a954
Nik | Klampfradler
authored
5 years ago
biscuit/apps/chronos/tables.py
+
9
−
7
Options
from
__future__
import
annotations
from
typing
import
Optional
from
django.utils.translation
import
ugettext_lazy
as
_
@@ -7,6 +9,13 @@ from django_tables2.utils import A
from
.models
import
LessonPeriod
def
_css_class_from_lesson_state
(
record
:
Optional
[
LessonPeriod
]
=
None
,
table
:
Optional
[
LessonsTable
]
=
None
)
->
str
:
if
record
.
get_substitution
(
table
.
_week
):
return
'
table-warning
'
else
:
return
''
class
LessonsTable
(
tables
.
Table
):
class
Meta
:
attrs
=
{
'
class
'
:
'
table table-striped table-bordered table-hover table-responsive-xl
'
}
@@ -22,10 +31,3 @@ class LessonsTable(tables.Table):
def
__init__
(
self
,
week
,
*
args
,
**
kwargs
):
self
.
_week
=
week
super
().
__init__
(
*
args
,
**
kwargs
)
def
_css_class_from_lesson_state
(
record
:
Optional
[
LessonPeriod
]
=
None
,
table
:
Optional
[
LessonTable
]
=
None
)
->
str
:
if
record
.
get_substitution
(
table
.
_week
):
return
'
table-warning
'
else
:
return
''
Loading