T
T
turekulovass2018-09-07 12:35:55
Django
turekulovass, 2018-09-07 12:35:55

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

1 answer(s)
S
Sergey Tikhonov, 2018-09-07
@turekulovass

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 question

Ask a Question

731 491 924 answers to any question