mirror of
https://github.com/Hopiu/django-select2.git
synced 2026-03-16 21:40:23 +00:00
Add model to AddressForm example
model also seems to be required in widget as shown in test - https://github.com/applegrew/django-select2/blob/master/tests/testapp/forms.py
This commit is contained in:
parent
2000395c3b
commit
c4b3fdfbef
1 changed files with 2 additions and 0 deletions
|
|
@ -37,6 +37,7 @@ Lets link two widgets via *dependent_fields*.
|
|||
queryset=Country.objects.all(),
|
||||
label=u"Country",
|
||||
widget=ModelSelect2Widget(
|
||||
model=Country,
|
||||
search_fields=['name__icontains'],
|
||||
)
|
||||
)
|
||||
|
|
@ -45,6 +46,7 @@ Lets link two widgets via *dependent_fields*.
|
|||
queryset=City.objects.all(),
|
||||
label=u"City",
|
||||
widget=ModelSelect2Widget(
|
||||
model=City,
|
||||
search_fields=['name__icontains'],
|
||||
dependent_fields={'country': 'country'},
|
||||
max_results=500,
|
||||
|
|
|
|||
Loading…
Reference in a new issue