Beispiel #1
0
 def attendance_dict(self, school: SchoolModel, student: StudentModel):
     """
     Return object data for viewing easily serializable format
     :param school:
     :param student:
     :return:
     """
     return {
         "id": self.id,
         "grade": self.grade,
         "year": self.year,
         "enrolled_date": self.enrolled_date.strftime("%d-%m-%Y"),
         "school": school.school_dict(),
         "student": student.student_dict()
     }
Beispiel #2
0
 def donation_dict(self, user: UserModel, student: StudentModel):
     """
     Return object data for viewing easily serializable format
     :param user:
     :param student:
     :return:
     """
     return {
         "id": self.id,
         "user": user.as_dict(),
         "year": self.year,
         "month": self.month,
         "student": student.student_dict(),
         "mmk_amount": self.mmk_amount,
         "jpy_amount": self.jpy_amount,
         "status": "pending" if self.paid_at is None else "paid"
     }