Dependent Drop Down

I am working with Function base view my requirement is dependent drop down means when i type zip code of particular area then show me all list of related to this pin code so it is possible in django pls help me.

What you are looking for is generally referred to as a “cascade select” list.

You’ll find some threads discussing this by searching these forums.

I suggest you start with: Search results for 'cascade select order:latest' - Django Forum

This is going to require additional views - your existing view is not going to do this for you. The short version is that there are a lot of suggestions for Select2.

Try to see my talk from Django con us 2022. There I give a full solution for that. In repository fo this presentation you can find examples, in my case - country and region.
ji7bt7pyxcl3daijybt9

Talk should be here: Hidden gems of Django Admin | DjangoCon US

That was a great talk by the way! I really appreciated it.

Thank you. Your talk (tutorials) about HTMX is also important! My opinion, it is future of Django!
By the way, right now i think - i should switch bounded-autocomplete-fields from jquery to HTMX!

Do you have an updated link to your solution @danilovmy as the link has no details other than about the talk and your bio card.

I’ve managed this myself by tweaking autocomplete.js and then overloading get_search_results so I could pass through additional querystring parameters as I could not work out how to pass in the additional args to the AutcompleteSelect widget in order for them to be picked up by the overloaded autocomplete.js file

in my repository for django con us 2022 you can find an example with corrected .js, folder autocompletes
Article is in draft, if you can not wait, write me privat message, i send you link to draft-article. i don’t want to publish link to draft

1 Like

Thank you! I will take a look