标签:search win esc request contains sea option data keyword
#课程搜索
search_keywords = request.GET.get(‘keywords‘, ‘‘)
if search_keywords:
all_course=all_course.filter(Q(name__icontains=search_keywords)|Q(desc__icontains=search_keywords)|
Q(work_position__icontains=search_keywords))
/顶部搜索栏搜索方法
function search_click(){
var type = $(‘#jsSelectOption‘).attr(‘data-value‘),
keywords = $(‘#search_keywords‘).val(),
request_url = ‘‘;
if(keywords == ""){
return
}
if(type == "course"){
request_url = "/course/list?keywords="+keywords
}else if(type == "teacher"){
request_url = "/org/teacher/list?keywords="+keywords
}else if(type == "org"){
request_url = "/org/list?keywords="+keywords
}
window.location.href = request_url
}
标签:search win esc request contains sea option data keyword
原文地址:http://www.cnblogs.com/onlyhold/p/7895021.html