@@ -60,31 +60,31 @@ You can use this as custom widget for `ManyToManyField`.
6060 # ...
6161 )
6262 ` ` `
63-
63+
64644. Use the widget in your model admin class:
6565
6666 ` ` ` python
6767 from django import models, forms
6868 from searchableselect.widgets import SearchableSelect
6969 from models import Traveler
70-
70+
7171 class TravelerForm(forms.ModelForm):
7272 class Meta:
7373 model = Traveler
7474 exclude = ()
7575 widgets = {
7676 ' cities_visited' : SearchableSelect(model=' cities.City' , search_field=' name' , many=True, limit=10)
7777 }
78-
79-
78+
79+
8080 class TravelerAdmin(admin.ModelAdmin):
8181 form = TravelerForm
82-
82+
8383 admin.site.register(Traveler, TravelerAdmin)
8484 ` ` `
8585
8686 Remember to ** always** initialize ` SearchableSelect` with three keyword arguments: ` model` , ` search_field` and ` many` .
87-
87+
8888 - ` model` is the string in form ` APP_NAME.MODEL_NAME` representing your model in the project, e. g. ' cities.City'
8989 - ` search_field` is the field within model that will be used to perform filtering, e. g. ' name'
9090 - ` many` must be ` True` for ` ManyToManyField` and ` False` for ` ForeignKey` .
@@ -97,7 +97,7 @@ Just run the project from `example` directory, head to http://127.0.0.1:8000, lo
9797# Supported versions
9898
9999 - Python 2.7.x: Django 1.7, 1.8, 1.9, 1.10
100- - Python 3.x: Django 1.8, 1.9, 1.10
100+ - Python 3.x: Django 1.8, 1.9, 1.10, 2.0
101101
102102# Testing
103103
@@ -119,7 +119,7 @@ coverage erase
119119# This command can be ran multiple times.
120120tox -e < python_ver> -< django_ver>
121121# Possible python_ver values: `py27`, `py36`
122- # Possible django_ver values: `17`, `18`, `19`, `110`
122+ # Possible django_ver values: `17`, `18`, `19`, `110`, '20'
123123# Values can be comma-seperated, e. g. `-e py27-17,py27-18,py36-18`
124124# If you omit `-e ...` parameter, all environments will be tests.
125125# Also - not problems with running this within a virtualenv.
0 commit comments