khue bui khue bui - 1 year ago 160
Python Question

Haystack django SearchQuerySet

I'm using Haystack Django for search engine.


the conds may include :

conds['name'] = Exact(name)
conds['category'] = Exact(category)
conds['city_id'] = Exact(city_id)

but beside I also want to add list of sub_category as conditions, so is there any way to add something like

conds['sub_category'] = list(city_id)

Answer Source

OK, the question seem to not clearly, I meant I want to add the key sub_category into the dictionary conds that values are list. So i found this way could answer the question above:

conds['sub_categary__in']  = sub_category_list
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download