views:

68

answers:

2

I want have have multiple filters on the data. like first i want to filter by date field and then by type field and then by some other field .... as many times as possible. i must pass on the field and value in the url and it must apply the filter and pass the data to the next filter.

A: 

You probably want django-filter.

Daniel Roseman
seems good will give it a try and get ack
+1  A: 

Conditions separated by commas are anded together:

SomeModel.objects.filter(cond1, cond2)

You can use Python's keyword expansion to pass them:

condlist = {}
condlist[cond1] = val1
condlist[cond2] = val2
SomeModel.objects.filter(**condlist)
Ignacio Vazquez-Abrams