十堰做网站的,wordpress 解析漏洞,西安做兼职网站,seo推广策略搜索手机号#xff1a; 最后一条就是使用的关键mobile__contains
使用字典#xff1a; 后端的逻辑#xff1a;
靓号列表data_dict {}search_data request.GET.get(q, )# 根据关键字进行搜索#xff0c;如果关键字存在 最后一条就是使用的关键mobile__contains
使用字典 后端的逻辑
靓号列表data_dict {}search_data request.GET.get(q, )# 根据关键字进行搜索如果关键字存在就进行搜索,返回搜索出的querysetif search_data:data_dict[mobile__contains] search_dataqueryset models.PrettyNum.objects.filter(**data_dict).order_by(-level)# 如果不存在,返回所有return render(request, pretty_list.html, {queryset: queryset, search_data:search_data})
前端页面提交到表单
div stylefloat: right;width: 300pxform methodgetdiv classinput-groupinput typetext nameq classform-control placeholderSearch for... value{{search_data}}span classinput-group-btnbutton classbtn btn-default typesubmitspan classglyphicon glyphicon-search aria-hiddentrue/span/button/span/div/form
/div