def create_teacher(): print("=========创建老师========") print("学校列表") school_list = School.get_all_school_list() for k, obj in enumerate(school_list, 1): print(k, obj) sid = int(input("请选择学校选项:")) school_obj = school_list[sid - 1] name = input("请输入教师姓名") teacher_obj = Teacher(name, school_obj.nid) teacher_obj.save()
def show_school(): print("=========学校========") school_list = School.get_all_school_list() for item in school_list: print(item.schoolName)