django-simple-autocomplete
django-simple-autocomplete copied to clipboard
how to properly instantiate AutoCompleteMultipleWidget ?
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.
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',)