django-simple-autocomplete icon indicating copy to clipboard operation
django-simple-autocomplete copied to clipboard

how to properly instantiate AutoCompleteMultipleWidget ?

Open erikwilliamson opened this issue 12 years ago • 1 comments

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.

erikwilliamson avatar Mar 25 '12 04:03 erikwilliamson

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',)

hedleyroos avatar Mar 31 '12 07:03 hedleyroos