toastdriven/django-haystack — Issue #467: TypeError: sequence item 0: expected string, People found
Author: ProgVal
Created: 2011-12-25 12:18:09+00:00
State: open

Hi,

I have this code:

```
print repr(query)
query = query.filter(author=people)
print repr(query)
```

where `query` is a SearchQuerySet and `people` an instance of a model called `People`. The first print statement prints `[]` and the second one errors in:

```
Traceback (most recent call last):
File "/home/progval/workspace/wididit/server/wididitserver/api.py", line 290, in read
print repr(query)
File "/usr/local/lib/python2.7/dist-packages/django_haystack-1.2.5-py2.7.egg/haystack/query.py", line 54, in __repr__
data = list(self[:REPR_OUTPUT_SIZE])
File "/usr/local/lib/python2.7/dist-packages/django_haystack-1.2.5-py2.7.egg/haystack/query.py", line 233, in __getitem__
self._fill_cache(start, bound)
File "/usr/local/lib/python2.7/dist-packages/django_haystack-1.2.5-py2.7.egg/haystack/query.py", line 138, in _fill_cache
results = self.query.get_results()
File "/usr/local/lib/python2.7/dist-packages/django_haystack-1.2.5-py2.7.egg/haystack/backends/__init__.py", line 452, in get_results
self.run()
File "/usr/local/lib/python2.7/dist-packages/django_haystack-1.2.5-py2.7.egg/haystack/backends/__init__.py", line 376, in run
final_query = self.build_query()
File "/usr/local/lib/python2.7/dist-packages/django_haystack-1.2.5-py2.7.egg/haystack/backends/simple_backend.py", line 112, in build_query
return self._build_sub_query(self.query_filter)
File "/usr/local/lib/python2.7/dist-packages/django_haystack-1.2.5-py2.7.egg/haystack/backends/simple_backend.py", line 123, in _build_sub_query
return (' ').join(term_list)
TypeError: sequence item 0: expected string, People found
```

I use the `simple` backend.

Regards,
ProgVal