Commit graph

229 commits

Author SHA1 Message Date
Johannes Hoppe
dca7dbc5d1 Fix #565 -- Support empty_label on ModelSelect fields. 2019-08-26 17:13:27 +02:00
predatell
8bd7f7209f Try to get queryset form choices, if possible (#509)
Get queryset for model widgets from choices. This omits the need to explicitly supply a queryset or model to the widget.
2019-07-09 18:38:59 +02:00
Johannes Hoppe
6b1ca10b06 Fix typo 2019-07-08 18:57:23 +02:00
Johannes Hoppe
4f96e21333 Resolve #557 -- Improve documentation for ModelSelect2TagWidget 2019-07-08 18:57:23 +02:00
Johannes Hoppe
8494b10fcc Fix pycodestyle issue 2019-06-10 18:03:23 +02:00
Mario Frasca
c15de464d5 Fix #544 -- Ensure correct attribute defaults (#547)
dict.setdefault() does not change the default value if called twice.
Therefore, defaults need to passed to the super call instead.
2019-06-10 17:09:04 +02:00
Vipul Chaudhary
898b2e84dd Fix #418 –– Remove extra Q created in the ORM query (#548)
The iterator for reduce function should not have the first element
select &= reduce(lambda x, y: x | Q(**{y: t}), search_fields[1:], Q(**{search_fields[0]: t}))
2019-06-10 16:57:17 +02:00
Johannes Hoppe
ffe91627d8 Add documentation for new request argument 2019-03-23 13:57:13 +01:00
Johannes Hoppe
9b54cc30c7 Add Django 2.2 support
Add Django 2.2 LTS support
Drop Django 1.11 LTS support
Add request argument to `ModelSelect2Mixin.filter_queryset`
2019-03-23 13:57:13 +01:00
Thomas Grainger
de7e7a1903 Publish django-select2 JavaScript code on NPM (#479) 2018-08-22 12:04:02 +02:00
Johannes Hoppe
f6eaa26c16 Fix #493 -- Fix Python 3.5 compatibility
Ref 1954bf57fa
2018-08-05 11:53:10 +02:00
Johannes Hoppe
e1d42bfcad Update Select2 library to version 4.0.5 2018-07-24 13:05:11 +02:00
Johannes Hoppe
1954bf57fa Add SELECT2_LIB_VERSION setting
The new setting allows to change to default library version to
a specific value without overriding all URLs individually.
2018-07-24 13:05:11 +02:00
Bill Yeh
aef27f48df Add option to exclude the Select2 library from form media (#484) 2018-06-30 14:58:47 +02:00
Johannes Hoppe
f31beec0c4
Add support for custom to_field names for foreign keys (#486)
Django's ForeignKey supports custom to_fields. The to field is the
primary key by default, but can be modified. The to field is also
used by forms to reduce database lookups.

This patch add support for custom to_field names on both model or
form layer.
2018-06-30 14:56:32 +02:00
dzhuang
496cc7c502 Fallback i18n js files for zh-hans/zh-hant. (#468)
* Fallback i18n js files for zh-hans/zh-hant.

* Use Django admin's built-in SELECT2_TRANSLATIONS to determine the lang of i18n js files.
2018-06-14 11:49:47 +02:00
Jan Pieter Waagmeester
17af750d88 Link to stable Django version docs not 1.8 (#480) 2018-05-31 09:30:22 +02:00
Johannes Hoppe
d9c899e8f7 Resolve pickle security note 2018-05-07 18:52:17 +02:00
Jan Pieter Waagmeester
2ea6ef8edb Fix typo in docstring ChoicesField -> ChoiceField (#472)
It's `django.forms.ChoiceField`, not `django.forms.ChoicesField`.

Used correctly here: 
a9aa31146f/django_select2/forms.py (L143)
2018-05-06 13:02:38 +02:00
Sergey Fedoseev
a9aa31146f Fixed display of ModelSelect2Mixin.filter_queryset() doc. (#470) 2018-03-24 14:25:42 +01:00
Alessio Ferri
426cace3a3 Improving documentation (#455) 2018-02-02 10:26:51 +01:00
Johannes Hoppe
f6d5afe51d Add support for Django 2.0 2017-11-25 18:56:46 +01:00
Johannes Hoppe
19e2e50921 Drop Django 1.8 and 1.10 support 2017-11-25 18:56:46 +01:00
Johannes Hoppe
1b1f345b3d Switch releases to pbr 2017-11-25 18:56:46 +01:00
Johannes Hoppe
f967eb643b Drop Python 2 support 2017-11-25 18:56:46 +01:00
Aaron WALKER
c07194e382 Fix incorrect i18n documentation 2017-09-07 16:40:31 +02:00
Johannes Hoppe
90028d9e36 Fix case issue -- get_langauge() only returns lower case
get_langauge() only returns lower case some i18n file name include
upper case language code tho. This will detect all lanugages.
2017-07-24 10:25:56 +02:00
Johannes Hoppe
b46f69f166 Add i18n support 2017-07-16 17:30:42 +02:00
Johannes Hoppe
b88e26bfa2 Switch to Chrome headless for selenium tests 2017-07-16 12:35:11 +02:00
Yuval Adam
018701680b Update ArrayField tagging widget documentation
This change reflects the new widget rendering APIs in Django 1.11
and enables the tagging widget to correctly show existing tags
2017-07-03 15:21:52 +02:00
Alexey Ruzin
1931a98240 Chained select2 2017-04-18 10:57:33 +02:00
Johannes Hoppe
5840622794 Add support for Django 1.11
Drop support for Django 1.9
2017-04-14 14:09:23 +02:00
Johannes Hoppe
895a7e519a Reformat JS to match StandardJS style 2017-02-23 10:04:36 +01:00
Johannes Hoppe
6180846345 Update test suite
- Add tox
- Add python 3.6
- Drop python 3.4
- Add chrome and gecko driver
- Switch tests from memcache to redis
2016-12-28 21:02:32 +01:00
Tim Tisdall
9430a950c2 refer to the correct class 2016-12-05 14:54:11 +01:00
Johannes Hoppe
1f9b094b67 v5.8.10 2016-12-05 14:52:54 +01:00
Tim Tisdall
15dbbf41a7 retain order of choices
If the choices are put into a `set` then the order is lost.  Regardless, I don't think a `set` is very useful here as this won't even deal with duplicate choice values/ids (ex. `(('1', 'one'), ('1', 'also one'))`)
2016-12-05 14:47:49 +01:00
Johannes Hoppe
e3c6919bbd Fix tests 2016-08-15 09:07:57 +02:00
Johannes Hoppe
9f5644b479 Upgrade select2 to 4.0.3 2016-08-15 08:58:34 +02:00
Johannes Hoppe
c797e59584 Bump version number to 5.8.7 2016-08-14 10:41:31 +02:00
Josef Kolář
72616f8276 ModelSelect2Mixin - avoid queryset evaluation (#287) 2016-08-14 10:38:57 +02:00
Johannes Hoppe
99aed19308 Write changelog bump version to 5.8.6 2016-06-19 12:29:45 +02:00
Jonas Haag
74bf15ce48 Drop six requirement, use django.utils.six instead (#282)
* Drop six requirement, use django.utils.six instead

* Drop six requirement, use django.utils.six instead

* Make isort happy
2016-06-19 12:27:49 +02:00
Johannes Hoppe
57dfd53d55 Bump version number 2016-05-23 16:18:39 +02:00
Johannes Hoppe
f943fe07f5 Fixes #256 -- Don't render empty option for multiselect (#275) 2016-05-23 16:17:31 +02:00
Julian
0b3abb8f1f Fixes minor documentation typo 2016-04-03 13:20:53 +02:00
Jônatas Castro
01c8979100 Fixes #238 -- Changed Token Separators
When Django was parsing the separator attribute, it was comming with 'u' char from unicode.
So the trick was to put the value in a String.
Solved https://github.com/applegrew/django-select2/issues/238

Closes #268
2016-03-10 15:34:30 +01:00
Damir Arbula
f6ee1f57db Add exception handling for cPickle.PicklingError to widget caching
Closes #265
2016-03-08 16:30:47 +01:00
Damir Arbula
9ed8f58fa6 Fixes #260 -- Normalize choices keys and selected choices to strings 2016-03-01 10:08:41 +01:00
Johannnes Hoppe
a8a4baf04d Fixes #261 -- Adds better hints if widget is not serialisable to django cache
Closes #263
2016-02-24 18:51:39 +01:00