django-selectable-select2

Plugin for django-selectable (to use with select2 UI)
Download

django-selectable-select2 Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Slawek Ehlert
  • Publisher web site:
  • https://bitbucket.org/slafs/

django-selectable-select2 Tags


django-selectable-select2 Description

django-selectable-select2 is a kind of a plugin for django-selectable.It provides widgets for use with a great JS library called select2 rather than jQuery UI. It also provides it's own Lookup classes for better (IMO) serialization results and limiting results (on server side).For now there's only a basic single-valued autocomplete widget for usage on ForeignKey (or simply ModelChoiceField) fields.Installation and usage- install django-selectable (you can ommit the part regarding jquery-ui)- add selectable_select2 to INSTALLED_APPS. So it look like this: INSTALLED_APPS = ( ... 'selectable', 'selectable_select2', ... )- define your lookup classWarningas for now (until issue #64 is resolved) you should inherit from selectable_select2.base.LookupBase and selectable_select2.base.ModelLookup- in your forms you can use selectable_select2.widgets.AutoCompleteSelect2Widget like so: from selectable_select2.widgets import AutoCompleteSelect2Widget from django import forms from myapp.models import MyModel # example model with a ForeignKey called ``myfk`` from myapp.lookups import MyModelLookup # the lookup defined in previous step class MyModelForm(forms.ModelForm): class Meta: model = MyModel widgets = { 'myfk' : AutoCompleteSelect2Widget(MyModelLookup, placeholder='select related item') }Check the example project for more details.Product's homepage


django-selectable-select2 Related Software