def remove_class():
tm = teachers_model.Teachers(flask.session['id'])
# show potential courses to remove on get request
if request.method == 'GET':
courses = tm.get_courses()
context = dict(data=courses)
return render_template('remove_class.html', **context)
# remove course by cid
elif request.method == 'POST':
cid = request.form['cid']
tm.remove_course(cid)
return flask.redirect(flask.url_for('main_teacher'))
评论列表
文章目录