Commit graph

175 commits

Author SHA1 Message Date
Johannes Hoppe
d57b726d34 Adds napoleon to march to google style signatures 2016-02-04 11:48:07 +01:00
Johannes Hoppe
d25e733c85 Fixes #245 -- Fixes ModelSelect2TagWidget documentation
There where multiple typos and missing references

Closed #248
2016-02-04 10:59:42 +01:00
Johannes Hoppe
0ee50d9866 Fixes pickel issue of lazy object 2016-01-27 10:01:19 +01:00
Johannes Hoppe
7d8908daab Fixes version number and QA issue 2016-01-26 17:55:56 +01:00
Johannes Hoppe
4a1b83ad1e Fixes security bug and adds secruity documentation
An attacker was able to use a `field_id` from a "secret" field
and use if on any even the default public select2 view and
receive the data without authentication.
2016-01-26 13:18:36 +01:00
mostafa-anm
33a00c1e39 Fixed #218 -- Add custom label support
Added `label_from_instance` method for model widgets to define custom option labels.

Closed #233
2016-01-19 08:50:09 +01:00
Andrew Dodd
89674ec375 Update conf.py
Minor copy-paste error.

Closed #240
2015-12-17 10:15:11 +01:00
Andrew Dodd
e655ed7a59 Add setting to change source of select2 assets
These changes introduce additional (optional) configuration parameters.
The parameters allow the user of the library to select different JS/CSS
libraries from the ones shipped. In particular, this allows serving from
the local server and/or in private-network-only environments.

Refs #220
Closed #239
2015-12-15 19:57:48 +01:00
Elijah Karari
3c06873148 Replace "patterns" with list in url config
`django.conf.urls.patterns` has been remmoved in Django 1.9.

Closed #236
2015-12-10 16:05:29 +01:00
Johannes Hoppe
6ebeb4c6d7 Fixed pep257 issues 2015-12-02 19:40:14 +01:00
Johannes Hoppe
4defb8112b Fixed #222 -- Display intital data for heavy widgets 2015-12-01 10:19:02 +01:00
Johannes Hoppe
bb90be77b7 Fixed #231 -- Avoid fetching entire queryset from db
Patched ciritcal memory leak in ModelSelect2 widgets.
Boolean evaluation of queryset makes django fetch all
elements.

Thanks to @magicjohnson for discovering this issue
2015-11-30 13:17:02 +01:00
Johannes Hoppe
18647161a1 Fixed docs 2015-11-29 20:47:22 +01:00
Royendgel Silberie
3e6c1fc3ba fixing small typo
Closed #227
2015-11-29 20:03:01 +01:00
Johannes Hoppe
19a8d63bb1 Refactors tag widgets and adds light tag widget
Currently there was no light version of the tag widget.
A light version might come handy if you use a postgres
`ArrayField` and a corresponding `SimpleArrayField`.

Resolved #226
2015-11-23 11:54:51 +01:00
Anne Fleischer
0457617738 Fixed javaScript bug for multiple different select2 fields on one page
Closed #224
2015-11-18 00:03:02 +01:00
Anne Fleischer
974ba552b0 Converted initialization code into configurable jQuery plugin
Closed #211
2015-11-12 12:50:58 +01:00
Thomas Schreiber
2beb5d23c7 Fix HeavySelect2TagWidget to respect custom attrs and default overrides
Closed #214
2015-10-27 17:44:22 +01:00
Johannes Hoppe
b8d53aa714 Added v5.2.0 changelog 2015-10-05 19:34:52 +02:00
Johannes Hoppe
b0d2325c43 Resolved #209 -- Added pagination 2015-10-05 19:01:43 +02:00
Johannes Hoppe
2c1eb8bc4a Fixed -- IndexError: pop from empty list 2015-10-05 12:59:35 +02:00
Johannes Hoppe
a91e66bf9e Created v5.1.0 release 2015-10-01 14:09:41 +02:00
Johannes Hoppe
75c8c38e2d Impooved cacheing to reduce pickling issues
Not not the entire widget gets cached nor the entire queryset.
The query and gets pickeld separately.
2015-10-01 14:07:51 +02:00
Johannes Hoppe
dc81c2b3b5 Added search term splitting 2015-10-01 13:05:52 +02:00
Johannes Hoppe
485ea191cb Fixed filter_queryset bug
The reduce statement coundn't handle multiple lookup strings.
2015-09-30 10:28:37 +02:00
Johannes Hoppe
4d484163c2 Fixed packaging error 2015-09-29 15:12:57 +02:00
Johannes Hoppe
e184f5fea6 Bump version number because v5.0.0 was taken on pypi due to mistake 2015-09-29 14:46:43 +02:00
Johannes Hoppe
f301dc6f9d Added documentation 2015-09-29 14:33:06 +02:00
Johannes Hoppe
5dfd8553cc Added tests 2015-09-29 13:55:05 +02:00
Johannes Hoppe
f80abb10f2 Added allow-clear support 2015-09-29 13:55:05 +02:00
Johannes Hoppe
6dad55eb11 Upgrade to select2 4.0 2015-09-29 13:55:05 +02:00
Johannes Hoppe
95297a362e Radical removal of all unneeded code 2015-09-29 13:54:23 +02:00
Johannes Hoppe
33b7dffca1 Removed own caching solution in favour of django caching
The old multiprocessing support was hard to maintain.
Since signing and caching are part of `django.core`
there is really no need to stick to our own solution.

As a result multimachine support and security are now always in place.
Fields are stored in Django's cache. The default cache used by select2
is called 'default' but can be cachanged overwriting the setting
`SELECT2_CACHE_BACKEND`.

Recommended cache backends are memcached, redis or a DB-cache.

Refactored AutoResponseView

The main reason for this refactoring is
the fact that the pagingnation was slow.

I dropped major parts of the initial code
and wrote a more django-like-approach.

Noteabley:
- get_results now retuns a QuerySet
- This commit drops django 1.6 support in favour of the JsonResponse (Backporting is possible).
2015-09-29 13:53:29 +02:00
Johannes Hoppe
29c74ae63e Fixed version number an changelog 2015-09-25 11:39:04 +02:00
Nirupam Biswas
905f691e01 New release updates 2015-09-25 00:27:03 +05:30
Quantum
5137c043ed Make static work with CachedStaticFilesStorage
`django.templatetags.static.static` doesn't return the hashed URL,
but `django.contrib.staticfiles.templatetags.staticfiles.static` does.
2015-08-26 16:38:26 -04:00
Anatoly Bubenkov
e829422a3f avoid deprecated force_unicode 2015-08-10 14:19:46 +02:00
Anatoly Bubenkov
91160484ac correct force to use unicode 2015-08-10 09:42:08 +02:00
Anatoly Bubenkov
d9c4a2cd5a Force unicode for widget choice labels 2015-08-10 09:39:02 +02:00
Razi Alsayyed
b576bcdd9e Made widget media a dynamic property
Symptoms:
While using AutoModelSelect2Field in admin site, I noticed that css files are rendered only at the first request to the add or edit forms, after that the widget is rendered but without loading any css files from get_select2_css_libs.

Solution:
I changed assets loading from Assets as a static definition to Media as a dynamic property as described at Django docs:
https://docs.djangoproject.com/en/1.8/topics/forms/media/#media-as-a-dynamic-property

Closed #179

Squashed commit of the following:

commit f925ed4a118687b82b6f61d21a9104ccf00859c8
Author: Razi Alsayyed <razi.sayed@gmail.com>
Date:   Fri Jun 19 01:39:47 2015 +0300

    remove trailing whitespace from docstrings

commit b3f6553e422e19c8e065e026511c4ffd91ffee42
Author: Razi Alsayyed <razi.sayed@gmail.com>
Date:   Fri Jun 19 01:35:15 2015 +0300

    Remove blank lines from docstrings

commit 4490b78572a25069472933c88ebee48445b59972
Author: Razi Alsayyed <razi.sayed@gmail.com>
Date:   Fri Jun 19 01:19:38 2015 +0300

    construct Media the right way

    Remove code that access private attributes of Media class.

commit 6697cd734daca62ff099be73d0685ce6af32e53d
Author: Razi Alsayyed <razi.sayed@gmail.com>
Date:   Tue Jun 16 00:11:29 2015 +0300

    fix

    change _media to _get_media

    I hope it is the final commit :)

commit 59bda01aed44e5658825a1bfe37ad09c5760a3ad
Author: Razi Alsayyed <razi.sayed@gmail.com>
Date:   Tue Jun 16 00:09:35 2015 +0300

    get_select2_heavy_js_libs

    change get_select2_js_libs to get_select2_heavy_js_libs

commit 993e201355c9d5a6012e6f67cfa64462576c2570
Author: Razi Alsayyed <razi.sayed@gmail.com>
Date:   Tue Jun 16 00:07:57 2015 +0300

    fix

    fix

commit f66e5f40b9f4df295bc5aaa7f2aafe588b2c41bb
Author: Razi Alsayyed <razi.sayed@gmail.com>
Date:   Mon Jun 15 23:55:53 2015 +0300

    fix

    fix

commit d33d90278345bc32e80e20bdf782fd9ac5eb1800
Author: Razi Alsayyed <razi.sayed@gmail.com>
Date:   Mon Jun 15 23:47:25 2015 +0300

    fix

    fix

commit f6d956149d2e99ee504c7b2c110f959f7472a181
Author: Razi Alsayyed <razi.sayed@gmail.com>
Date:   Mon Jun 15 23:45:09 2015 +0300

    fix

    fix

commit 6d737a78cc07507c5b9b91736f6662b5f6f31c57
Author: Razi Alsayyed <razi.sayed@gmail.com>
Date:   Mon Jun 15 23:40:01 2015 +0300

    global name 'Media' is not defined

    global name 'Media' is not defined

commit 661a817b092dc72bfa8df1a5458d474599c0a50e
Author: Razi Alsayyed <razi.sayed@gmail.com>
Date:   Mon Jun 15 23:27:27 2015 +0300

    Media as a dynamic property

    **Symptoms:**
    While using AutoModelSelect2Field in admin site, I noticed that css files are rendered only at the first request to the add or edit forms, after that the widget is rendered but without loading any css files from get_select2_css_libs.

    **Solution:**
    I changed assets loading from [Assets as a static definition](https://docs.djangoproject.com/en/1.8/topics/forms/media/#media-as-a-dynamic-property) to [Media as a dynamic property](https://docs.djangoproject.com/en/1.8/topics/forms/media/#media-as-a-dynamic-property) as described at Django docs.
2015-06-19 14:49:51 +02:00
Daniel Hahler
de37752ac6 doc: fix typos/grammar 2015-06-08 11:35:09 +02:00
Eugene Morozov
8cc2253a5b Support proper translation of placeholders using ugettext_lazy. 2015-06-08 14:51:03 +06:00
Quantum
b5a154d425 Fix HeavySelect2MultipleWidget
"selector not found" error similar to 2bf42c5bda.

Closed #174
2015-06-01 10:22:49 +01:00
Sergey Fursov
bfee65fc95 return list of css links instead of generator 2015-05-05 15:59:16 +03:00
Nirupam Biswas
5f9477b664 Version 4.3.1 2015-04-29 01:14:11 +05:30
Sergey Fursov
c7101223f8 updated minified versions of static files 2015-04-28 19:53:05 +03:00
Nirupam Biswas
a57cb59436 Fixing setup.py and releasing 4.3.0. 2015-04-27 22:19:15 +05:30
Ben Cail
2bf42c5bda fix HeavySelect2Widget (with automated test) 2015-04-20 15:31:04 -04:00
Jonathan Senecal
1419dd9121 Fix selector is not defined javascript error
Closed #167
2015-04-13 18:45:35 +02:00
Jonathan Senecal
439852102b Updated select2.js to 3.5.2 2015-04-13 18:45:25 +02:00