Skip to content
0:00 / 0:00

#django#django-autocomplete-light#autocomplete

django-autocomplete-light-1.0.17

djangoyourlabs

67 subscribers • 1 video on Hallway

YouTube
  • Recommended by 1 person: 1 on Stack Overflow and its sister sites.
  • Linked in the descriptionyourlabs/django-autocomplete-light
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Intermediate. Assumes working knowledge.

53K views14 years ago1 recommendation

Web developmentPythonVue, Svelte, Angular and others

A demonstration of using django-autocomplete-light to implement autocomplete widgets inside and outside the Django admin panel.

Demonstration of django-autocomplete-light 1.0.17 (Update: django-autocomplete-light is now at version 1.0.24). Links: Example using autocomplete_light outside the admin: - In demo (install it first): localhost:8000/non_admin/widget/add/ - Source: github.com/yourlabs/django-autocomplete-light/tree/master/te… - Docs (extensive): django-autocomplete-light.readthedocs.org/en/latest/forms.ht… Example using autocomplete_light outside the admin with a + add another link: - In demo (install it first): localhost:8000/non_admin_add_another/widget/add/ - Source: github.com/yourlabs/django-autocomplete-light/tree/master/te… - Docs: django-autocomplete-light.readthedocs.org/en/latest/addanoth… Ask questions: github.com/yourlabs/django-autocomplete-light/issues/new

Why it's here

1 person recommends this

What people say. Recommended as a solution for handling large ManyToMany fields in Django forms without timing out.

Francis Yaconielloon Stack Overflow • Recommends

On “Django form with ManyToMany field with 500,000 objects times out”

You need to create a custom widget for this field that lets you autocomplete for the correct record. If you don't want to roll your own: http://django-autocomplete-light.readthedocs.io/ I've used this for its generic relationship support, the M2M autocomplete looks pretty easy and intuitive as well. see video of use here: link to this video After reading your comment about needing it outside the admin, I took another look at the django-autocomplete-light library. It provides widgets you can use outside the admin. from dal import autocomplete from django import forms class PersonForm(forms.ModelForm): class Meta: widgets = { 'myformfield': autocomplete.ModelSelect2( # ... ), }