Wednesday, August 29, 2018

Searchable dropdown from models

I am trying to create a searchable dropdown list  based on Django's model. I have a model M that has 6 objects [apple,orange,carrot,banana,kiwi,peach].
I want to create a view that will have a search box like a html datalist. when user types in "app" -- apple should show in dropbox list. then as user clicks on apple, the form should send id of object apple to the view.

I am using with

which gives me a dropdown list. But i am unable to implement a search box.
Not much documentation is found online about this issue. Is there a better approach?


You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment