Hi,
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 forms.py with
forms.ModelChoiceField(queryset=M.objects.all()
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?
Thanks