Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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-Core
Commits
807a04f9
Commit
807a04f9
authored
5 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Bug fixes
parent
fee17411
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!86
Merge school-apps
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
schoolapps/untisconnect/api.py
+11
-3
11 additions, 3 deletions
schoolapps/untisconnect/api.py
schoolapps/untisconnect/events.py
+6
-3
6 additions, 3 deletions
schoolapps/untisconnect/events.py
with
17 additions
and
6 deletions
schoolapps/untisconnect/api.py
+
11
−
3
View file @
807a04f9
...
...
@@ -292,7 +292,13 @@ class Absence(object):
self
.
filled
=
True
print
(
db_obj
.
ida
)
print
(
db_obj
.
typea
)
self
.
type
=
TYPE_TEACHER
if
db_obj
.
typea
!=
102
and
db_obj
.
typea
!=
100
else
TYPE_ROOM
if
db_obj
.
typea
==
101
:
self
.
type
=
TYPE_TEACHER
elif
db_obj
.
typea
==
100
:
self
.
type
=
TYPE_CLASS
elif
db_obj
.
typea
==
102
:
self
.
type
=
TYPE_ROOM
if
self
.
type
==
TYPE_TEACHER
:
print
(
"
IDA
"
,
db_obj
.
ida
)
self
.
teacher
=
get_teacher_by_id
(
db_obj
.
ida
)
...
...
@@ -310,6 +316,7 @@ def get_all_absences_by_date(date):
db_rows
=
run_all
(
models
.
Absence
.
objects
.
filter
(
dateto__gte
=
d_i
,
datefrom__lte
=
d_i
,
deleted
=
0
),
filter_term
=
False
)
return
row_by_row_helper
(
db_rows
,
Absence
)
#########
# EVENT #
#########
...
...
@@ -319,8 +326,8 @@ class Event(object):
self
.
filled
=
None
self
.
text
=
None
self
.
teachers
=
[]
self
.
classes
=
[]
self
.
rooms
=
[]
self
.
classes
=
[]
self
.
rooms
=
[]
self
.
absences
=
[]
self
.
from_date
=
None
self
.
to_date
=
None
...
...
@@ -362,6 +369,7 @@ def get_all_events_by_date(date):
db_rows
=
run_all
(
models
.
Event
.
objects
.
filter
(
dateto__gte
=
d_i
,
datefrom__lte
=
d_i
,
deleted
=
0
),
filter_term
=
False
)
return
row_by_row_helper
(
db_rows
,
Event
)
##########
# LESSON #
##########
...
...
This diff is collapsed.
Click to expand it.
schoolapps/untisconnect/events.py
+
6
−
3
View file @
807a04f9
...
...
@@ -53,9 +53,12 @@ class Event(object):
self
.
rooms
.
append
(
obj
)
if
element
[
4
]
!=
"
0
"
and
element
[
4
]
!=
""
:
absence
=
models
.
Absence
.
objects
.
using
(
"
untis
"
).
get
(
absence_id
=
int
(
element
[
4
]))
self
.
absences
.
append
(
absence
)
print
(
element
[
4
])
try
:
absence
=
models
.
Absence
.
objects
.
using
(
"
untis
"
).
get
(
absence_id
=
int
(
element
[
4
]))
self
.
absences
.
append
(
absence
)
except
models
.
Absence
.
DoesNotExist
:
pass
self
.
text
=
db_obj
.
text
self
.
from_date
=
untis_date_to_date
(
db_obj
.
datefrom
)
self
.
to_date
=
untis_date_to_date
(
db_obj
.
dateto
)
...
...
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