Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to pass extra parameters from the form into get_items #51

Open
AlexCLeduc opened this issue Oct 17, 2023 · 0 comments
Open

Ability to pass extra parameters from the form into get_items #51

AlexCLeduc opened this issue Oct 17, 2023 · 0 comments

Comments

@AlexCLeduc
Copy link
Collaborator

A requirement that is coming up more and more often is that we wanted cascading choices e.g. a dropdown choice should filter the possibilities of a following autocomplete field of the same form.

This is currently impossible and I'm not even sure how we would implement such a feature. On the autocomplete request side it's easy, we would add a optional_params kwarg or something and stick in the optional filter params there, this is also a good place to add the request (#42) others have requested in the past but we refrained because it was a breaking-change.

On the consumer side, it's a bit more complicated. Ideally we'd want the user to allow extra params to be passed. These can come from the form dynamically or statically from some variable. In the case of forms, ideally we could rename the form-field so that the same autocomplete class and get_items implementation can be re-used in different forms that use different field names for the same type of data.

(Note that for the static case, there is a meta-programming workaround: generate as many autocomplete classes are there are possibilities. This is kind of hacky and won't work for user-picked options)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant