Skip to content

Commit

Permalink
Merge branch 'release/1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
asyncee committed Jun 22, 2015
2 parents a37a2c2 + d848c0c commit e197cac
Show file tree
Hide file tree
Showing 118 changed files with 12,204 additions and 4,874 deletions.
20 changes: 12 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Project aims to support **Python 2.7**, **3.3** and **3.4**,
**Django 1.6**, **1.7** and **1.8**.


**UPGRADE NOTES** : Version 1.3 introduced backward incompatible
changes. Read more in changelog_.

Also, ``Select2`` library was upgraded from **3.4**
to **4.0.0**. If you are tied to older version, please, use
``django-easy-select2 1.2.13``.


How it looks
------------

Expand All @@ -22,18 +30,12 @@ Select one of existing values with single-valued choice field
:target: https://github.com/asyncee/django-easy-select2/raw/master/screenshots/select2_single.png

Easily select 1 or more "categories" for your project, you can also
add a new one in the normal, Django-Admin manner by using the green + button
with multiple-valued choice field (ManyToManyField):
add a new one in the normal, Django-Admin manner by using the
green + button with multiple-valued choice field (ManyToManyField):

.. image:: https://github.com/asyncee/django-easy-select2/raw/master/screenshots/select2_multiple.png
:target: https://github.com/asyncee/django-easy-select2/raw/master/screenshots/select2_multiple.png

Don't see the "mood" you want? No problem, just type in a new one.
It will be there as a choice for the next time too (text input).

.. image:: https://github.com/asyncee/django-easy-select2/raw/master/screenshots/select2_text_input.png
:target: https://github.com/asyncee/django-easy-select2/raw/master/screenshots/select2_text_input.png


Quickstart
----------
Expand All @@ -59,6 +61,8 @@ You can read more in the documentation_.

.. _documentation: http://django-easy-select2.readthedocs.org

.. _changelog: http://django-easy-select2.readthedocs.org/en/latest/changelog.html

.. |pypi| image:: https://img.shields.io/pypi/v/django-easy-select2.svg?style=flat-square
:target: https://pypi.python.org/pypi/django-easy-select2
:alt: pypi
Expand Down
13 changes: 13 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
Changelog
=========

Version 1.3
-----------

.. WARNING::

Version 1.3 introduced backward incompatible changes, read below.

- `Select2` updated to 4.0.0
- updated `jQuery` to 2.1.3
- removed deprecated `select2_meta_factory`, `Select2TextMixin` and
`Select2TextInput`.


Version 1.2
-----------
1.2.13
Expand Down
6 changes: 0 additions & 6 deletions docs/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,3 @@ with multiple-valued choice field (ManyToManyField):

.. image:: https://github.com/asyncee/django-easy-select2/raw/master/screenshots/select2_multiple.png
:target: https://github.com/asyncee/django-easy-select2/raw/master/screenshots/select2_multiple.png

Don't see the "mood" you want? No problem, just type in a new one.
It will be there as a choice for the next time too (text input).

.. image:: https://github.com/asyncee/django-easy-select2/raw/master/screenshots/select2_text_input.png
:target: https://github.com/asyncee/django-easy-select2/raw/master/screenshots/select2_text_input.png
19 changes: 1 addition & 18 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ Usage
-----

There are :class:`.Select2` and
:class:`.Select2Multiple` widget classes for
choice fields and :class:`.Select2TextInput`
for non-choice fields which can prodive a list of pre-set choices,
or can accept arbitrary input.
:class:`.Select2Multiple` widget classes for choice fields.

You can use ``Select2`` and ``Select2Multiple`` on any form field,
as usual django widget::
Expand Down Expand Up @@ -33,20 +30,6 @@ or::
class and custom render method, which applies `$.fn.select2()`
method on html input.

To use :class:`.Select2TextInput` do NOT set a choices attribute on the
model field, but DO supply a :attr:`data` attribute to :attr:`select2attrs`
that contains a list of dictionaries each having at least an :attr:`id`
and :attr:`text` terms like so::

form.fields['myfield'].widget = Select2TextInput(
select2attrs={
'data': [ {'id': 'your data', 'text': 'your data'}, ... ],
},
)

``Select2TextInput`` will be rendered as combo-box widget that can
accept arbitrary input, but also has some default choices for user.

.. WARNING::

Since version 1.2.9 :attr:`select2attrs` should be of type `dict`
Expand Down
9 changes: 3 additions & 6 deletions easy_select2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
__all__ = [
'select2_meta_factory', 'select2_modelform_meta', 'select2_modelform',
'select2_modelform_meta', 'select2_modelform',
'Select2', 'Select2Multiple', 'Select2Mixin', 'apply_select2',
'Select2TextMixin', 'Select2TextInput',
]

from easy_select2.utils import (
select2_meta_factory, select2_modelform_meta, select2_modelform,
apply_select2,
select2_modelform_meta, select2_modelform, apply_select2,
)
from easy_select2.widgets import (
Select2Mixin, Select2, Select2Multiple, Select2TextMixin,
Select2TextInput,
Select2Mixin, Select2, Select2Multiple,
)
2 changes: 1 addition & 1 deletion easy_select2/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.utils.encoding import force_text


M = _(' Hold down "Control", or "Command" on a Mac, to select more than one.')
M = _('Hold down "Control", or "Command" on a Mac, to select more than one.')
class FixedModelForm(forms.ModelForm):
"""
Simple child of ModelForm that removes the 'Hold down "Control" ...'
Expand Down
8 changes: 8 additions & 0 deletions easy_select2/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# coding: utf-8

#
# Models `Related`, `TestFieldsModel` and `EmptyModel` are
# used only in tests.
#


from django.db import models


Expand Down
3 changes: 3 additions & 0 deletions easy_select2/static/easy_select2/css/easy_select2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ul.select2-selection__rendered li {
list-style-type: none;
}
11 changes: 4 additions & 7 deletions easy_select2/static/easy_select2/vendor/jquery/jquery.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit e197cac

Please sign in to comment.