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

Problem in filter-by mechanism #176

Open
amikphoto opened this issue Oct 27, 2024 · 2 comments
Open

Problem in filter-by mechanism #176

amikphoto opened this issue Oct 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@amikphoto
Copy link

amikphoto commented Oct 27, 2024

If the number of options (the number of records in the database table) in Selectize is greater than the max_prefetch_choices constant, the "filter-by" filtering mechanism does not work. The request to receive _fetch_options does not come from the frontend.

The same problem was in this issue
#162

@jrief jrief added the bug Something isn't working label Oct 27, 2024
@jrief
Copy link
Owner

jrief commented Oct 27, 2024

I will check. Thanks for reporting.

@codematsing
Copy link

My workaround for this is to override the widget

from formset.widgets import Selectize

class CustomSelectize(Selectize):
	max_prefetch_choices = 700 # or some number > 250
	# customize due to cap of original

class Form(forms.Form):
       foo = forms.ModelChoiceField(..., widget=CustomSelectize())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants