Hi, i want options of state below changed acc. to country user selected,
i see url below mentioned "Generate options based on time or context" - but no idea how to implement it, help please, thanks!
https://offerrall.github.io/FuncToWeb/dropdowns/#use-cases-for-dynamic-dropdowns
STATES = {
'country1': ['state1', 'state2'],
'country2': ['state3', 'state4'],
}
def _get_countries():
return list(STATES)
def _get_states(country):
return STATES[country]
def population(
country: Literal[_get_countries],
state: Literal[_get_states]
):
"""population of state of country"""
return f'country={country}, state={state}'
run(population)
Hi, i want options of
statebelow changed acc. tocountryuser selected,i see url below mentioned "Generate options based on time or context" - but no idea how to implement it, help please, thanks!
https://offerrall.github.io/FuncToWeb/dropdowns/#use-cases-for-dynamic-dropdowns