Answer the question
In order to leave comments, you need to log in
How to make django-filter show up on every page?
Hello! I'm using django-filter for filtering in a bulletin board project, since manually writing filters is a pain. Here is an example of one request:
def filter(request):
if ('hotels' and 'place' and 'men' and 'pitanie' and 'stoyanka' and 'beach' and 'child' and 'bassein' and 'internet' and 'sauna' and 'tv') in request.GET:
newvar = Hotels.objects.filter(category__slug='hotels').filter(place__title=request.GET['place']).filter(pitanie=True,stoyanka=True,beach=True,child=True,bassein=True,internet=True,sauna=True,tv=True)
return render_to_response('filter.html',{'newvar':newvar,})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question