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
c404437a
Commit
c404437a
authored
6 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Add corridors and supervisions to substitutions
parent
9ad6370b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
biscuit/apps/untis/api.py
+32
-0
32 additions, 0 deletions
biscuit/apps/untis/api.py
biscuit/apps/untis/sub.py
+8
-5
8 additions, 5 deletions
biscuit/apps/untis/sub.py
with
40 additions
and
5 deletions
biscuit/apps/untis/api.py
+
32
−
0
View file @
c404437a
...
...
@@ -158,6 +158,38 @@ def get_room_by_id(id):
return
one_by_id
(
room
,
Room
)
########
# CORRIDOR #
########
class
Corridor
(
object
):
def
__init__
(
self
):
self
.
filled
=
False
self
.
id
=
None
self
.
name
=
None
def
__str__
(
self
):
if
self
.
filled
:
return
self
.
name
or
"
Unbekannt
"
else
:
return
"
Unbekannt
"
def
create
(
self
,
db_obj
):
self
.
filled
=
True
self
.
id
=
db_obj
.
corridor_id
self
.
name
=
db_obj
.
name
def
get_all_corridors
():
corridors
=
row_by_row
(
models
.
Corridor
,
Corridor
,
filter_term
=
False
)
return
corridors
def
get_corridor_by_id
(
id
):
print
(
id
)
corridor
=
run_one
(
models
.
Corridor
.
objects
,
filter_term
=
False
).
get
(
corridor_id
=
id
)
return
one_by_id
(
corridor
,
Corridor
)
###########
# SUBJECT #
###########
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/untis/sub.py
+
8
−
5
View file @
c404437a
...
...
@@ -2,7 +2,7 @@ from django.utils import timezone
from
untisconnect
import
models
from
untisconnect.api
import
run_default_filter
,
row_by_row_helper
,
get_teacher_by_id
,
get_subject_by_id
,
\
get_room_by_id
,
get_class_by_id
get_room_by_id
,
get_class_by_id
,
get_corridor_by_id
from
untisconnect.api_helper
import
run_using
,
untis_split_first
from
untisconnect.parse
import
get_lesson_by_id
,
get_lesson_element_by_id_and_teacher
...
...
@@ -20,7 +20,7 @@ def date_to_untis_date(date):
TYPE_SUBSTITUTION
=
0
TYPE_CANCELLATION
=
1
TYPE_TEACHER_CANCELLATION
=
2
TYPE_CORRIDOR
=
3
def
parse_type_of_untis_flags
(
flags
):
type_
=
TYPE_SUBSTITUTION
...
...
@@ -100,9 +100,12 @@ class Substitution(object):
self
.
room_new
=
None
# if self.rooms_old
print
(
self
.
room_new
)
self
.
corridor
=
db_obj
.
corridor_id
# print(self.room_new)
# print("CORRIDOR")
# print(self.corridor)
if
db_obj
.
corridor_id
!=
0
:
self
.
corridor
=
get_corridor_by_id
(
db_obj
.
corridor_id
)
self
.
type
=
TYPE_CORRIDOR
# Classes
self
.
classes
=
[]
...
...
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