FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

new: Students.gender · robquant/python-webuntis@83c8a57 · GitHub

Repository navigation

Commit 83c8a57

Browse files
committed
new: Students.gender
1 parent 55ce894 commit 83c8a57

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎tests/test_session.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,4 @@ def test_students(self):
326326
student = st[0]
327327
assert type(student) == webuntis.objects.StudentObject
328328
assert student.full_name == "Alexander Mueller"
329+
assert student.gender == "male"

‎webuntis/objects.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,9 @@ def full_name(self):
718718
"""full name of student (forname, longname)"""
719719
return " ".join((self.fore_name, self.long_name)).strip()
720720

721+
@lazyproperty
722+
def gender(self):
723+
return self._data[u'gender']
721724

722725
class StudentsList(ListResult):
723726
_itemclass = StudentObject

‎webuntis/objects.pyi‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ class StudentObject(PersonObject):
308308
def full_name(self) -> str:
309309
...
310310

311+
@property
312+
def gender(self) -> str:
313+
...
311314

312315
class StudentsList(ListResult):
313316
_itemclass = StudentObject

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL