V
V
vfvnvsyevsky2015-05-07 09:12:38
Django
vfvnvsyevsky, 2015-05-07 09:12:38

How to use queryset in SearchQuerySet haystack query?

How to check the following:

queryset = Table.objects.filter(table_field = field)
SearchQuerySet().filter(table_field = queryset)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
skorpix, 2016-02-24
@skorpix

I, of course, may be a necroposter, but it seems to me that this should be done as follows (suddenly someone will find this answer useful):

table_ids = Table.objects.filter(table_field = field).values_list('id', flat=True)
SearchQuerySet().filter(table_field__in = table_ids)

Did not check for correctness and correctness.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question