I have a model with an ImageField that I’m indexing for search using Django Haystack, and I’d like to use the images in my search results. Correct me if I’m wrong, but you can not have an ImageField in a Django Haystack SearchQuerySet. So what is the best way to access the model ImageFields associated with a SearchQuerySet? Do I really have to loop over the model ids and add them to a separate QuerySet?
Share
Just use
result.object.my_image_field. Theobjectattribute contains the full Django object associated with the search result.