Overview

Django autocomplete

Provides autocomplete widgets.

To Use:

Add autocomplete to you INSTALLED_APPS.

Add the autocomplete.urls to your urls. e.g.

urlpatterns += patterns(
(r'^autocomplete/', include('autocomplete.urls')),

)

Use the autocomplete widgets in your forms

from autocomplete.widgets import AutocompleteSelectMultiple

class Topping(models.Model):
name = forms.CharField(max_length=250, required=True)
class PizzaForm(forms.ModelForm):
toppings = forms.ModelMultipleChoiceField(Topping, widget=AutocompleteSelectMultiple(Topping, search_fields=['name']), )

To get it working in the templates, you need to include the media, for example:

{% block extra_head %}
{{ form.media }}

{% endblock %}