def patientdb(): booked = root.child('Checkup').get() list = [] for pubid in booked: bookedpatients = booked[pubid] if bookedpatients['fullname']: bookedpatient = Schedule(bookedpatients['fullname'], bookedpatients['gender'], bookedpatients['contact'], bookedpatients['address'], bookedpatients['dateofbirth'], bookedpatients['nric'], bookedpatients['condition'], bookedpatients['email'], bookedpatients['scheduledate'],bookedpatients['emergencycontactname'], bookedpatients['emergencycontact'], bookedpatients['time']) bookedpatient.set_pubid(pubid) print(bookedpatient.get_pubid()) list.append(bookedpatient) return render_template('patientdb.html', booked=list)