本文整理汇总了Python中course.Course.select_courses方法的典型用法代码示例。如果您正苦于以下问题:Python Course.select_courses方法的具体用法?Python Course.select_courses怎么用?Python Course.select_courses使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类course.Course
的用法示例。
在下文中一共展示了Course.select_courses方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from course import Course [as 别名]
# 或者: from course.Course import select_courses [as 别名]
def test():
reqargs = request.args.getlist('clsl')
department_string = request.args.get('dep')
course_name_filter_string = request.args.get('cnf')
prof_name_filter_string = request.args.get('pnf')
course_day_filter_string = request.args.get('cdf')
course_time_filter_string = request.args.get('ctf')
sex_filter_int = (request.args.get('jens') and int(request.args.get('jens'))) or 0
dep_filter = department_filter(department_string)
course_name_filter = parse_courfilter_string(course_name_filter_string)
prof_name_filter = parse_proffilter_string(prof_name_filter_string)
course_day_filter = parse_dayfilter_string(course_day_filter_string)
course_time_filter = parse_timefilter_string(course_time_filter_string)
sex_filt = sex_filter(sex_filter_int)
final_filter = and_filter(course_name_filter,
prof_name_filter,
course_day_filter,
course_time_filter,
dep_filter,
sex_filt)
selected_courses = Course.select_courses(courses, reqargs)
user = ''
if 'username' in session:
user = session['username']
if selected_courses:
selected_user_courses[user] = selected_courses
unselected_courses = [
cour for cour in courses if not cour in selected_courses]
return render_template('main_template.html',
selected_courses=selected_courses,
unselected_courses=filter(
final_filter, unselected_courses),
user=user,
filter_strings=[course_name_filter_string,
prof_name_filter_string,
course_day_filter_string,
course_time_filter_string,
department_string,
sex_filter_int],
departments=departments)
示例2: schedule
# 需要导入模块: from course import Course [as 别名]
# 或者: from course.Course import select_courses [as 别名]
def schedule():
reqargs = request.args.getlist('clsl')
selected_courses = Course.select_courses(courses, reqargs)
return render_template('schedule.html', selected_courses=selected_courses)