I have a little probleme with Haystack.
I have a search form and when it’s submited,i do a research in 3 models, so I simply use :
SearchQuerySet().models(Video,User,PlayList).auto_query(query)
Now i need to filter() objects from PlayList’s model.
but if i do :
SearchQuerySet().models(Video,User).auto_query(query).models(PlayList).auto_query(query).filter(
Q(user=request.user)|
Q(user__userprofilepermission__playlist='all'))
The filter() will be used for the 3 models (as written in the doc).
So I think to do that :
result1 = SearchQuerySet().models(Video,User).auto_query(query)
result2 = SearchQuerySet().models(PlayList).auto_query(query).filter(
Q(user=request.user)|
Q(user__userprofilepermission__playlist='all'))
But I want to return juste one variable, and I don’t know how to join result1&result2.
Anyone has an idea ?
thanks.
QuerySets tend to be glorified lists so a quick way to do this would be: