[Fixed]-Dynamic drop-down list in Django forms

1👍

Are you sure you want a dropdown with 10,000 entries? Is so, in forms.py:

class CompanySignupForm(forms.ModelForm):
    company = forms.ChoiceField(choices=["10,000", "entries", "here"])

https://docs.djangoproject.com/es/1.9/ref/forms/fields/#choicefield

But I would opt for an autocomplete field, using http://django-autocomplete-light.readthedocs.org/en/master/

👤xbello

Leave a comment