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

How do you limit the number of choices of the widget #458

Closed
superflyer11 opened this issue Aug 9, 2021 · 1 comment · Fixed by #525
Closed

How do you limit the number of choices of the widget #458

superflyer11 opened this issue Aug 9, 2021 · 1 comment · Fixed by #525

Comments

@superflyer11
Copy link

Is there a built-in setting to limit the number of choices to specific ones? Or do I need to override the select widget?

@amateja
Copy link
Collaborator

amateja commented Mar 14, 2022

Currently there is no other way than a hacky one. After instantiation of PhoneNumberPrefixWidget you might access PhoneNumberPrefixWidget.widgets property, get an instance of PhonePrefixSelect and alter PhonePrefixSelect.choices property.

On the other hand we might change both PhoneNumberPrefixWidget and PhonePrefixSelect constructor to accept choices argument... but I need to get some thumbs up on it.

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

Successfully merging a pull request may close this issue.

2 participants