Skip to content

omni-digital/django-autocomplete

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

===================
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 %}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 50.1%
  • Python 36.9%
  • CSS 12.7%
  • Makefile 0.3%