Commit graph

258 commits

Author SHA1 Message Date
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
Johannes Hoppe
b9400e235b Merge pull request #197 from DMOJ/static-patch
Make static work with CachedStaticFilesStorage
2015-08-27 10:48:53 +02:00
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
Johannes Hoppe
992ad4de01 Merge pull request #191 from bubenkoff/patch-1
Force unicode for widget choice labels
2015-08-11 16:30:34 +02: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
Johannes Hoppe
66a36c3ea2 Added tests for django master 2015-08-06 10:10:44 +02:00
Johannes Hoppe
4f84f01434 Fixed badges 2015-07-10 10:20:14 +02:00
Johannes Hoppe
68a6f44171 Added badges and moved changelog into separate file
Closed #188
2015-07-10 10:16:50 +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
Johannes Hoppe
a38eb1168b Changed travis tests to supported versions 2015-06-17 17:06:20 +02:00
Johannes Hoppe
1d49045477 Merge pull request #177 from blueyed/doc-fixes
doc: fix typos/grammar
2015-06-08 14:54:47 +02:00
Daniel Hahler
de37752ac6 doc: fix typos/grammar 2015-06-08 11:35:09 +02:00
Johannes Hoppe
1224b8d65c Merge pull request #176 from emorozov/master
Support proper translation of placeholders using ugettext_lazy.
2015-06-08 11:02:59 +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
Pawel Iwaszko
77cecbd1cf Added failing test for HeavySelect2MultipleWidget
Closed #175
2015-06-01 10:21:01 +01:00
AppleGrew
7850d52b64 Merge pull request #171 from GeyseR/patch-2
return list of css links instead of generator
2015-05-22 03:04:35 +05:30
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
AppleGrew
b2917fff53 Merge pull request #170 from GeyseR/patch-1
Fixed bug in minify pre-setup function
2015-04-29 01:08:14 +05:30
Sergey Fursov
c7101223f8 updated minified versions of static files 2015-04-28 19:53:05 +03:00
Sergey Fursov
b19f166992 Fixed bug in minify pre-setup function
Collect all files from collection instead of last one only
2015-04-28 17:35:55 +03:00
Nirupam Biswas
a57cb59436 Fixing setup.py and releasing 4.3.0. 2015-04-27 22:19:15 +05:30
Johannes Hoppe
6092d96aea Merge pull request #168 from bcail/master
Fixed HeavySelect2Widget (incl automated test)
2015-04-24 11:04:14 +02:00
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
Jonathan Senecal
88e88f53bd Fix "No reverse match" issue with template. 2015-04-13 18:45:25 +02:00
Jonathan Senecal
13065d09e8 Added the "fields" attribute in testapp
django.core.exceptions.ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form SchoolForm needs updating.
- Added the "fields" attribute to SchoolForm
- Added the "fields" attribute to EmployeeForm
- Added the "fields" attribute to DeptForm
- Added the "fields" attribute to QuestionForm
- Added the "fields" attribute to QuestionNonAutoForm
2015-04-13 18:44:06 +02:00
Jonathan Senecal
1b5e7e18d3 PEP8 + simple typo 2015-04-13 18:42:30 +02:00
Jonathan Senecal
2737bb996b Fixed simple typo 2015-04-13 18:42:30 +02:00
Johannes Hoppe
cc9ded6fdc Fixed #103 -- Fixed inheritance issue
Both mixins implemented almost an identical functionaly and both called super.
That caused AutoHeavySelect2Mixin to call the wrong super class and executed wrong js code.
2015-04-10 11:10:42 +02:00
Johannes Hoppe
d988cc683e Removed method check because it done by dispatch 2015-04-10 10:16:01 +02:00
Johannes Hoppe
5d9b463f2e Added six for metaclasses 2015-04-10 10:15:20 +02:00
Johannes Hoppe
8377f31f2e Merge pull request #160 from superqwer/django18
Fixed django1.8 compatibility issues
2015-04-08 17:56:25 +02:00
Johannes Hoppe
3126434a8f Merge pull request #161 from bcail/master
Fixed Select2Mixin hashedSelector
2015-04-08 17:55:10 +02:00
Johannes Hoppe
b07ad8939c Removed Django from install requirements added 1.8 tests 2015-04-08 17:46:29 +02:00
Ben Cail
537c8ec40b Select2Widget test: move general error check to the end of the function; test that the select2 results get displayed when the widget is clicked 2015-04-08 08:47:34 -04:00
Johannes Hoppe
d9d928a336 Merge pull request #159 from superqwer/imports
Fixed imports
2015-04-08 09:13:00 +02:00
Ben Cail
12b00c1084 define hashedSelector in Select2Mixin 2015-04-06 14:41:24 -04:00
Ben Cail
28e8b54425 add a failing test for Select2Widget (hashedSelector not defined) 2015-04-06 14:29:13 -04:00
superqwer
bedb4b3c24 django1.8 compatibility issues 2015-04-06 16:31:23 +03:00