该程序根据传入的kind参数,分别选择UpdateStudentView或UpdateTeacherView视图函数,并根据request中的session中的id、name、kind信息,构建context字典传入视图函数中。如果kind参数不是"student"或"teacher",则返回INVALID_KIND。如果func未被赋值,则返回login视图函数。

def updaterequest kind func = None if kind == student func = UpdateStudentViewas_view elif kind == teacher func = UpdateTeacherViewas_view if func pk = requestsessiong

原文地址: https://www.cveoy.top/t/topic/e1Mv 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录