@@ -475,6 +475,21 @@ def __init__(self, json_dict: dict) -> None:
475
475
476
476
del self ._resolver
477
477
478
+ class OtherAbsence (Object ):
479
+ """
480
+ Represents a absence with a given period. You shouldn't have to create this class manually.
481
+
482
+ Attributes:
483
+ id (str): the id of the absence (used internally)
484
+ name (str): the justification for the absence
485
+ """
486
+
487
+ def __init__ (self , json_dict : dict ) -> None :
488
+ super ().__init__ (json_dict )
489
+ self .id : str = self ._resolver (str , "N" )
490
+ self .name : str = self ._resolver (str , "L" )
491
+
492
+ del self ._resolver
478
493
479
494
class Period (Object ):
480
495
"""
@@ -640,6 +655,21 @@ def punishments(self) -> List[Punishment]:
640
655
absences = response ["donneesSec" ]["donnees" ]["listeAbsences" ]["V" ]
641
656
return [Punishment (self ._client , a ) for a in absences if a ["G" ] == 41 ]
642
657
658
+ @property
659
+ def otherabsences (self ) -> List [OtherAbsence ]:
660
+ """
661
+ All "Other Absences" from a given period, not yet classified. I found type 46 for a forgotten notebook.
662
+ """
663
+ json_data = {
664
+ "periode" : {"N" : self .id , "L" : self .name , "G" : 2 },
665
+ "DateDebut" : {"_T" : 7 , "V" : self .start .strftime ("%d/%m/%Y %H:%M:%S" )},
666
+ "DateFin" : {"_T" : 7 , "V" : self .end .strftime ("%d/%m/%Y %H:%M:%S" )},
667
+ }
668
+
669
+ response = self ._client .post ("PagePresence" , 19 , json_data )
670
+ absences = response ["donneesSec" ]["donnees" ]["listeAbsences" ]["V" ]
671
+ return [OtherAbsence (a ) for a in absences if a ["G" ] == 46 ]
672
+
643
673
644
674
class Average (Object ):
645
675
"""
0 commit comments