Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a helper to index monolingual objects #3

Open
sbaechler opened this issue Oct 29, 2015 · 0 comments
Open

Add a helper to index monolingual objects #3

sbaechler opened this issue Oct 29, 2015 · 0 comments

Comments

@sbaechler
Copy link
Owner

This backend assumes that every indexed model is multilingual. So for a given object all index entries share the same django-id.

This doesn't work for apps where the language is filtered on the manager level (i.e. the model has a language attribute).

Unfortunately the environment language is not set when haystacks index_queryset is evaluated.

A possible solution for this is a decorator class that wraps the queryset returned by index_queryset and filters it as soon as the language is available.

Haystack does slice the queryset before the language filtering can happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant