Answer the question
In order to leave comments, you need to log in
What are the values of ModelSelect2Widget, django_select2 arguments?
I want to use ModelSelect2Widget for dependent dropdowns. But I can't understand what values the following arguments should give and what they are for:
* search_fields=['region_id'],
* dependent_fields={'region': 'region'}.
I just know dependent_fields for dependency. Can you explain it?
Answer the question
In order to leave comments, you need to log in
https://django-select2.readthedocs.io/en/latest/ex...
The example shows what is what.
search_fields - model fields to search for input text
dependent_fields - keys - name of the form field that triggers recalculation, values - names of the model field for filtering.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question