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

how to properly instantiate AutoCompleteMultipleWidget ? #4

Open
erikwilliamson opened this issue Mar 25, 2012 · 1 comment
Open

how to properly instantiate AutoCompleteMultipleWidget ? #4

erikwilliamson opened this issue Mar 25, 2012 · 1 comment

Comments

@erikwilliamson
Copy link

Hi,

First off: Thanks for your work on this!

I thought that doing this in my Forms.py:
tags = forms.ModelChoiceField(queryset=Tag.objects.all(), initial=3, widget=AutoCompleteMultipleWidget())

would do autocompletion for each individual word that is entered - am I incorrect? If so, could there please be some documentation added saying this isn't the expected behaviour (unless I'm way off here). Or does the code you've submitted actually do this, and I'm doing it wrong?

Thanks for your help!
Erik.

@hedleyroos
Copy link
Contributor

Hi Erik

In your case you do not have to do widget=AutoCompleteMultipleWidget(), but even so it should work. Did you create an entry for Tag in settings.py? In its simplest form it would be

SIMPLE_AUTOCOMPLETE_MODELS = ('theproduct.Tag',)

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

No branches or pull requests

2 participants