Skip to content

Commit

Permalink
Version 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
true-world committed Jan 27, 2018
1 parent e009aba commit 98b89fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,31 @@ You can use this as custom widget for `ManyToManyField`.
# ...
)
```

4. Use the widget in your model admin class:

```python
from django import models, forms
from searchableselect.widgets import SearchableSelect
from models import Traveler
class TravelerForm(forms.ModelForm):
class Meta:
model = Traveler
exclude = ()
widgets = {
'cities_visited': SearchableSelect(model='cities.City', search_field='name', many=True, limit=10)
}
class TravelerAdmin(admin.ModelAdmin):
form = TravelerForm
admin.site.register(Traveler, TravelerAdmin)
```

Remember to **always** initialize `SearchableSelect` with three keyword arguments: `model`, `search_field` and `many`.

- `model` is the string in form `APP_NAME.MODEL_NAME` representing your model in the project, e. g. 'cities.City'
- `search_field` is the field within model that will be used to perform filtering, e. g. 'name'
- `many` must be `True` for `ManyToManyField` and `False` for `ForeignKey`.
Expand All @@ -97,7 +97,7 @@ Just run the project from `example` directory, head to http://127.0.0.1:8000, lo
# Supported versions

- Python 2.7.x: Django 1.7, 1.8, 1.9, 1.10
- Python 3.x: Django 1.8, 1.9, 1.10
- Python 3.x: Django 1.8, 1.9, 1.10, 2.0

# Testing

Expand All @@ -119,7 +119,7 @@ coverage erase
# This command can be ran multiple times.
tox -e <python_ver>-<django_ver>
# Possible python_ver values: `py27`, `py36`
# Possible django_ver values: `17`, `18`, `19`, `110`
# Possible django_ver values: `17`, `18`, `19`, `110`, '20'
# Values can be comma-seperated, e. g. `-e py27-17,py27-18,py36-18`
# If you omit `-e ...` parameter, all environments will be tests.
# Also - not problems with running this within a virtualenv.
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='django-searchable-select',
version='1.4.5',
version='1.5.0',
description='django-searchable-select - a better and faster multiple selection widget with suggestions for Django',
long_description="""django-searchable-select
========================
Expand Down Expand Up @@ -126,7 +126,7 @@ class TravelerAdmin(admin.ModelAdmin):
==================
- Python 2.7.x: Django 1.7, 1.8, 1.9, 1.10
- Python 3.x: Django 1.8, 1.9, 1.10
- Python 3.x: Django 1.8, 1.9, 1.10, 2.0
Known issues
============
Expand Down

0 comments on commit 98b89fb

Please sign in to comment.