本文整理匯總了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)