Reputation: 9549
I have a query that looks like this:
conditions={'sector': u'65', 'tax_type': u'cleaning', 'district': u'22'}
qs = Something.objects.filter(**conditions)
But there raise an error:
'QuerySet' object has no attribute 'objects'
How can I make the dynamic queryset with dictionary contain the filter name and conditions in django?
Upvotes: 1
Views: 170
Reputation: 99620
Looks like Something
is already a QuerySet
Just do
qs = Something.filter(**conditions)
Upvotes: 2