V
V
vfvnvsyevsky2015-03-19 17:44:24
Django
vfvnvsyevsky, 2015-03-19 17:44:24

Why is haystack throwing an error?

I pass the request itself to the get view with a request and from which to which line to pull out.

args['items'] = SearchQuerySet().filter(тут запрос)[from_items:to_items]

It gives the following error:
coercing to Unicode: need string or buffer, int found
Empirically, it was found out that from_items causes an error in the request, and if you replace the variable with a number, then everything is OK. Even if this variable is assigned a numeric value instead of a digit from get, then everything is ok. Already broke his head, what could be the problem?
Traceback:
e85b3756f7e24a579ec72c807e553f56.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vfvnvsyevsky, 2015-03-19
@vfvnvsyevsky

For some inexplicable reason, it was necessary to wrap from_items in int (). Programming is magic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question