django-haystack icon indicating copy to clipboard operation
django-haystack copied to clipboard

how to dynamically assign column-name to auto complete function?

Open Thundersoul opened this issue 12 years ago • 1 comments

I want to do like something info=SearchQuerySet().autocomplete(col_name[0]="abc") But when I do this it gives error "SyntaxError: keyword can't be an expression" and if I do var=col_name[0] and then info=SearchQuerySet().autocomplete(var="abc") it doesn't return anything.Can anyone help me to solve this issue or point out what I am doing wrong? I want dynamically assignment of column name All the field passing to the col_name[] are EdgeNgramField field.

Thundersoul avatar Sep 29 '14 12:09 Thundersoul

This is a Python question, not something related to Haystack. See https://docs.python.org/2/glossary.html#term-argument for information about how to use **kwargs for this.

acdha avatar Sep 29 '14 13:09 acdha