Skip to content

Commit

Permalink
Version 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
and3rson committed Oct 28, 2016
1 parent 94b6dec commit a1caf8a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ You can use this as custom widget for `ManyToManyField`.

# Example app

Just run the project from `example` directory, head to [http://127.0.0.1:8000], login as `admin`/`admin` and try adding Cats!
Just run the project from `example` directory, head to http://127.0.0.1:8000, login as `admin`/`admin` and try adding Cats!

# Known issues

Expand Down
23 changes: 15 additions & 8 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.3',
version='1.4',
description='django-searchable-select - a better and faster multiple selection widget with suggestions for Django',
long_description="""django-searchable-select
========================
Expand Down Expand Up @@ -85,21 +85,22 @@
.. code:: python
from django import models, forms
from models import MyModel
from searchableselect.widgets import SearchableSelect
from models import Traveler
class MyModelForm(forms.ModelForm):
class TravelerForm(forms.ModelForm):
class Meta:
model = models.MyModel
model = Traveler
exclude = ()
widgets = {
'cities': SearchableSelect(model='cities.City', search_field='name')
'cities_visited': SearchableSelect(model='cities.City', search_field='name')
}
class MyModelAdmin(admin.ModelAdmin):
form = Form
class TravelerAdmin(admin.ModelAdmin):
form = TravelerForm
admin.site.register(models.MyModel, MyModelAdmin)
admin.site.register(Traveler, TravelerAdmin)
Remember to **always** initialize ``SearchableSelect`` with three
keyword arguments: ``model``, ``search_field`` and ``many``.
Expand All @@ -111,6 +112,12 @@ class MyModelAdmin(admin.ModelAdmin):
- ``many`` must be ``True`` for ``ManyToManyField`` and ``False``
for ``ForeignKey``.
Example app │
===========
Just run the project from `example` directory, head to http://127.0.0.1:8000, login as ``admin``/``admin`` and try adding Cats!
Known issues
============
Expand Down

0 comments on commit a1caf8a

Please sign in to comment.