def studentData(student_id): student_id = int(student_id) if not student_id: return name = fetch.studentFullName(student_id) #rint ' popup details for student ', student_id, name school_name = '' course_title = '' batch_name = '' # bs.batch_id, n.nis, s.first_name, s.middle_name, s.last_name, \ # s.birth_date, s.gender, s.ship_id, b.course_title_id, ct.school_id, s.national_no, ct.course_level studentDetails = fetch.studentSchDetails(student_id) age = '' gender = '' ship = '' if studentDetails: school_id = studentDetails['school_id'] school_name = fetch.schoolName(school_id) course_title_id = studentDetails['course_title_id'] course_title = fetch.courseTitle(course_title_id) age = studentDetails['birth_date'] gender = fetch.gender(studentDetails['gender']) ship = fetch.shipName(studentDetails['ship_id']) batch_id = fetch.batchID_forStudent(student_id) if batch_id: batch_name = fetch.batchName(batch_id) schDetails(name, school_name, course_title, batch_name, age, gender, ship)
def forms_forMentor(cmb, staff_id): id_list = fetch.batches_forMentor(staff_id) #rint 'batches_forMentor , id_list', id_list originalIndex = int(cmb.GetSelection()) if originalIndex > -1:origional_id = cmb.GetClientData(originalIndex) else: origional_id = 0 cmb.Clear() if not id_list:return cmb.Freeze() # locks the combo so that other processes are not called select = 0 index = 0 for id in id_list: title = fetch.batchName(id) cmb.Append(title, id) if id == origional_id: select = index index += 1 cmb.Select(0) if originalIndex > -1: cmb.Select(select) cmb.Thaw()