Exemplo n.º 1
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"
     }