2020
09-24
09-24
django列表筛选功能的实现代码
views,中设置请求的类型classLawDetailView(View):defget(self,request,law_id):type=request.GET.get('type','')law=Law.objects.get(id=law_id)returnrender(request,'zcfg-detail.html',{'law':law,'type':type,})templates,中设置:<divclass="col-lg-12"style="margin-bottom:20px;"><aclass="{%iftype==''%}btnbtn-danger{%else%}btnbtn-default{%endif%}"href="?t...
继续阅读 >