From c4b3fdfbef60d0730a92026840c75dbdd4ce66be Mon Sep 17 00:00:00 2001 From: Phoebe Bright Date: Wed, 23 Aug 2017 22:07:32 +0100 Subject: [PATCH] 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 --- docs/extra.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/extra.rst b/docs/extra.rst index 972902d..664fe20 100644 --- a/docs/extra.rst +++ b/docs/extra.rst @@ -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,