Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Untis
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-Untis
Commits
f234ac77
Commit
f234ac77
authored
6 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Correct date in PDF (skip weekend) | Tidy up [TIMETABLE/SUBSTITUTIONS]
parent
6b95d549
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
biscuit/apps/untis/sub.py
+10
-8
10 additions, 8 deletions
biscuit/apps/untis/sub.py
with
10 additions
and
8 deletions
biscuit/apps/untis/sub.py
+
10
−
8
View file @
f234ac77
...
...
@@ -69,7 +69,7 @@ class Substitution(object):
# Lesson
# Teacher
print
(
db_obj
.
teacher_idlessn
)
#
print(db_obj.teacher_idlessn)
if
db_obj
.
teacher_idlessn
!=
0
:
self
.
teacher_old
=
get_teacher_by_id
(
db_obj
.
teacher_idlessn
)
if
db_obj
.
teacher_idsubst
!=
0
:
...
...
@@ -79,7 +79,7 @@ class Substitution(object):
self
.
teacher_new
=
None
self
.
lesson_element
=
get_lesson_element_by_id_and_teacher
(
self
.
lesson_id
,
self
.
teacher_old
)
print
(
self
.
lesson
)
#
print(self.lesson)
# Subject
self
.
subject_old
=
self
.
lesson_element
.
subject
if
self
.
lesson_element
is
not
None
else
None
...
...
@@ -111,7 +111,7 @@ class Substitution(object):
self
.
classes
=
[]
class_ids
=
untis_split_first
(
db_obj
.
classids
,
conv
=
int
)
print
(
class_ids
)
#
print(class_ids)
for
id
in
class_ids
:
self
.
classes
.
append
(
get_class_by_id
(
id
))
...
...
@@ -195,6 +195,8 @@ def generate_sub_table(subs):
sub_row
.
room
=
"
<s>{}</s> → <strong>{}</strong>
"
.
format
(
sub
.
room_old
.
shortcode
,
sub
.
room_new
.
shortcode
)
elif
sub
.
room_new
and
not
sub
.
room_old
:
sub_row
.
room
=
sub
.
room_new
.
shortcode
elif
not
sub
.
room_new
and
not
sub
.
room_old
:
pass
else
:
sub_row
.
room
=
sub
.
room_old
.
shortcode
...
...
@@ -219,10 +221,10 @@ def get_substitutions_by_date(date):
# print(subs_raw)
subs
=
row_by_row_helper
(
subs_raw
,
Substitution
)
print
(
subs
)
for
row
in
subs
:
print
(
row
.
classes
)
for
class_
in
row
.
classes
:
print
(
class_
.
name
)
#
print(subs)
#
for row in subs:
#
print(row.classes)
#
for class_ in row.classes:
#
print(class_.name)
subs
.
sort
(
key
=
substitutions_sorter
)
return
subs
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