Commit graph

216 commits

Author SHA1 Message Date
Dylan Verheul
28c2d5649e Resolved #83 -- Refactored widget Media
Squashed commit of the following:

commit 2544866077707f068ab2c411a1dbcea4e3ec47e8
Author: Dylan Verheul <dylan@zostera.nl>
Date:   Thu Dec 12 13:16:22 2013 +0100

    Proper fixing of #81 and #82

commit 8e640a874d96171befae023c8d7c1dcb43e2bd6d
Author: Dylan Verheul <dylan@zostera.nl>
Date:   Thu Dec 12 11:50:43 2013 +0100

    Move testing of RENDER_SELECT2_STATICS to Media class, fixes #81
2015-04-02 18:44:23 +02:00
Johannes Hoppe
32c1e1eb5b Merge pull request #156 from onysos/master
fix on 4.2.2 with django 1.7 : is_hidden = True
2015-03-31 15:25:02 +02:00
Johannes Hoppe
bd40acc761 Added six types and fixed setup 2015-03-31 10:22:03 +02:00
darius BERNARD
0e331d5e33 added unittest for bug #156 2015-03-30 17:00:37 +02:00
darius BERNARD
ea9ae1176e Merge remote-tracking branch 'upstream/master'
Conflicts:
	django_select2/widgets.py
2015-03-30 16:33:18 +02:00
darius BERNARD
8e5d988e89 fix on 4.2.2 with django 1.7 : is_hidden = True
with django 1.7, is hidden in no loger an attribute
but a property which compare input_type with "hidden"
this commit make sur that is_hidden will always be False

can be merged in 4.2.2
2015-03-30 11:35:36 +02:00
Johannes Hoppe
2cfbfd3325 Code cleanup -- Added pep8 tests for package. 2015-03-30 10:19:37 +02:00
Ben Cail
91dad724fb Adds render_inner_js_code to HeavySelect2TagWidget
Add a test for HeavyModelSelect2TagField in the testapp.
The labels for selected options aren't displayed correctly in the test.
I updated HeavySelect2TagWidget to override render_inner_js_code, and now it seems to work properly.

Closes #133

Squashed commit of the following:

commit 94895a8743b0c4ebdf888da08827486106a5b15d
Author: Ben Cail <benjamin_cail@brown.edu>
Date:   Tue Nov 18 15:11:24 2014 -0500

    use view name instead of hard-coded url

commit fb9e1444ed73f2c8bad071182e8919dbf4f6bfe6
Author: Ben Cail <benjamin_cail@brown.edu>
Date:   Mon Nov 17 14:31:50 2014 -0500

    override render_inner_js_code in HeavySelect2TagWidget (similar to AutoHeavySelect2Mixin)

commit feff9c2a76474121aa2ff9c9b98a4f7dbfb0ab49
Author: Ben Cail <benjamin_cail@brown.edu>
Date:   Mon Nov 17 14:21:29 2014 -0500

    add test for HeavyModelSelect2TagField
2015-02-24 10:15:13 +01:00
Evgenii Shchemelev
e8580ed23d removed unnecessary db request 2014-10-07 18:01:49 +06:00
Thomas Schreiber
c2abdbd63f do not replace dashes on the selector id variable 2014-09-13 16:12:21 +02:00
Thomas Schreiber
1b57be5cd5 do not replace dashes on the selector variable 2014-09-13 16:05:04 +02:00
Thomas Schreiber
8d76a61791 prevent dashes in javascript variable names 2014-09-13 15:16:20 +02:00
Thomas Schreiber
e0686628d7 add the hashed field_id to the 'data-select2-id' attr 2014-09-13 03:04:44 +02:00
Thomas Schreiber
36bac0570f Support dynamic inline formsets w/ select2 fields.
* Previously, when using {{ form.empty_form }} the inline js would
    automatically be called on the `empty_form`. This made it impossible
    to dynamically add inlines to the page because of how
    `__prefix__` is duplicated to the new inlines.

    This commit wraps all the inline js in a function which is attached
    to global `window.django_select2` plugin. On page load only non
    `empty_form`'s are initialized with select2, giving the developer to
    attach to the 'add new inline' click and call the `django_select2`
    plugin with the proper inline formset id. I am using this now with
    `django-superformset` and dynamically inserted inlines that contain
    select2 fields are working as expected.

    Additionally all the inline js for each formset is identicaly, a
    future cleanup could be to only inline the field and form id
    variables.

  * First converted `widgets.py` to Unix file type so the diff does not
    contain windows line endings.

  * Since all the inline js is now run post page load, we can put all of
    the`django_select2` js libraries at the page bottom with other js assets.
    refs #51

  * As a bonus, this removes all the js code generation libs from utils with
    json.dumps().

  * I have not tried formsets with the django admin, however this work
    will allow inline formsets support to be added to the admin with
    less developer effort than before.

Refs: #125, #65, #49, #32, #109
2014-09-11 22:58:17 +02:00
Thomas Schreiber
a9df6ad390 convert to unix filetype
Conflicts:
	django_select2/widgets.py
2014-09-11 22:58:02 +02:00
Thomas Schreiber
a563c62d33 Add django_select2 to the global space.
When javascript output is wrapped django_select2 can not be found,
adding it to the window instead of a var fixes this:
https://django-pipeline.readthedocs.org/en/latest/configuration.html#wrapped-javascript-output
2014-09-11 22:55:04 +02:00
AppleGrew
4f8fbb5f93 Merge pull request #115 from fjcapdevila/master
Fix typos
2014-06-12 08:55:04 +05:30
fjcapdevila
fd87d86344 typo 2014-06-11 12:34:43 -03:00
fjcapdevila
c7561ecde1 Typo 2014-06-11 12:25:21 -03:00
fjcapdevila
73d9e6cb90 Typo 2014-06-11 12:16:48 -03:00
AppleGrew
3f968c1532 Merge pull request #114 from fjcapdevila/master
Minor changes in doc-strings
2014-06-11 02:16:34 +05:30
fjcapdevila
3b8ba099a3 Minor format typo 2014-06-10 12:43:59 -03:00
fjcapdevila
5004b79c85 Typo
Little type
2014-06-10 12:23:24 -03:00
AppleGrew
40b2b9dbfc Merge pull request #113 from fjcapdevila/master
Fix another typos
2014-06-10 11:00:12 +05:30
fjcapdevila
4edeff61af Fix another typo
FIx another typo in a doc-string
2014-06-09 18:15:31 -03:00
AppleGrew
89c4f07643 Merge pull request #111 from jdotjdot/master
added '.distinct()' to result query on ModelJsonMixin
2014-06-10 02:28:52 +05:30
fjcapdevila
f354e54f91 Fix typo
Fix typo in a doc-string
2014-06-09 17:55:55 -03:00
fjcapdevila
26f9deaf90 Fix typo
Fix typo in a doc-string.
2014-06-09 17:33:43 -03:00
JJ
d27f04dec4 added '.distinct()' to result query on ModelJsonMixin to prevent duplicates 2014-06-09 16:00:41 -04:00
Bhaskar
6d1746cd21 Updated select2.js with latest version 3.4.2 to 3.4.8:
- When any of the duplicated options are selected, the values are not being cleared(in 3.4.2) after removing them, working in 3.4.8
2014-06-09 23:33:18 +05:30
Jonathan Liuti
7721d6aeb5 Documentation improvement.
I have just been bitten by this.

While it's really related to select2, due to the fact that django-select2 adds his bits of abstraction on top of select2, I wasted quite some time making sure nothing was wrong with django-select2 in the first place...

Hope it can help others, or help me if I happen to forget about it ;)
2014-04-24 11:24:31 +02:00
Bob
21e80ac2d6 Fix 1.4, 1.5 support in render_texts_for_value
Django 1.6 introduces field.empty_values.  This makes it compatible.
2014-04-08 12:49:27 -04:00
Pavel
400b5bde39 typo 2014-01-10 21:53:59 +03:00
AppleGrew
d11c127747 Merge pull request #76 from crccheck/fix-typos
Fix typos in the documentation
2013-11-19 19:52:07 -08:00
crccheck
3d800e6868 update capitalization of proper nouns
I usually spell ajax as AJAX, but after doing some reasearch, it seems
like Ajax is more commonly used.
2013-11-19 19:09:19 -06:00
crccheck
66a0ebfe99 fix random typos found while reading the project 2013-11-19 19:00:58 -06:00
apalazon
3f13e0cab4 Fix issue #74: Regen heavy_data.min.js 2013-11-19 19:25:56 +01:00
apalazon
c4fe791508 Fix issue #74: Change MULTISEPARATOR value from String.fromCharCode(0) to String.fromCharCode(31) to solve a problem with Internet Explorer 2013-11-19 19:03:43 +01:00
7wonders
a1d2206260 Added the new minified bootstrap css 2013-11-12 00:14:41 +01:00
7wonders
6322a26e7f Added built in minify script changes so that select2-bootstrap is minified for production 2013-11-08 04:53:35 +01:00
7wonders
3be6962993 Adds bootstrap 3 support to make select2 look a little nicer 2013-11-08 03:34:03 +01:00
AppleGrew (applegrew)
7d66164e65 Bumping to v4.2.2. 2013-11-05 21:28:05 +05:30
AppleGrew
1c67a47ceb Update widgets.py 2013-10-10 01:13:37 +05:30
Eugene Morozov
c939010007 Use fully qualified jQuery name to avoid conflict with other js frameworks. 2013-10-07 22:35:38 +05:30
Eugene Morozov
b4feb53ea4 Do not assume that jQuery is bound to $ variable. 2013-10-07 22:03:00 +05:30
AppleGrew
604130b06e Update fields.py 2013-09-27 20:10:44 +05:30
AppleGrew
0c46114f56 Update fields.py 2013-09-27 20:08:09 +05:30
AppleGrew
8cb1b0d82f Added doc to get_queryset. 2013-09-27 20:04:06 +05:30
Rémy HUBSCHER
71a7171e2f Fix #59 - Add a get_queryset helper to be able to provide a site related queryset. 2013-09-24 16:33:38 +02:00
AppleGrew (applegrew)
564bfd3467 v4.2.1 2013-09-17 23:10:14 +05:30
AppleGrew (applegrew)
cc94db7e2b Issue 54. Widget performance fix. 2013-09-17 22:02:32 +05:30
AppleGrew (applegrew)
096162ac84 Changed some log levels. 2013-09-16 11:37:34 +05:30
AppleGrew (applegrew)
e9035ede04 Updating docs. 2013-09-16 02:43:52 +05:30
AppleGrew (applegrew)
ab57470b02 Adding Tagging support. 2013-09-16 02:03:08 +05:30
AppleGrew (applegrew)
12ad5255d0 Bumping Select2 JS version to 3.4.2. 2013-09-15 13:38:41 +05:30
Agris Ameriks
5db7791b20 Removed empty term validation.
Why are you validating that term is filled? If I want to suggest values immediately after opening select2 input, I specify select2_options {"minimumResultsForSearch": 0, "minimumInputLength": 0,}.

Why isn't this valid case? Maybe I'm missing something, but see it very useful to suggest, for example, last used values immediately after opening select2 field.

Thanks!
2013-09-06 18:55:11 +03:00
AppleGrew (applegrew)
683d29fd2b Added debug code to heavy_data.js 2013-07-06 17:31:13 +05:30
AppleGrew (applegrew)
fe1fb4fd76 Updating Select2 JS to 3.4.1 2013-07-06 10:04:18 +05:30
Michal Ociepka
ddbbb6a98c Add proper _has_changed for HiddenInput
Fixes #45
2013-06-12 16:43:30 +02:00
AppleGrew
93243616f3 Fixing issue#39. Added mark_safe() to MultipleSelect2HiddenInput.render(). 2013-05-02 10:45:55 +05:30
iMom0
80f52a4b27 Do not import urls defaults 2013-03-27 12:14:45 +08:00
AppleGrew (applegrew)
e082822cdd v4.0.0 Added Hashed Id generation scheme 2013-03-15 11:30:40 +05:30
AppleGrew (applegrew)
f58f608b23 v3.3.1 commit 2013-03-13 00:29:02 +05:30
AppleGrew (applegrew)
05b69c89b6 * Multi-process support. * Updated Select2 to 3.3.1. 2013-03-02 11:25:00 +05:30
AppleGrew (applegrew)
b39268f42d Issue#26 fix. 2013-02-28 21:17:20 +05:30
AppleGrew (applegrew)
4e1243bfec Issue#23 fix. 2013-02-28 14:18:27 +05:30
AppleGrew
7515dad006 Update django_select2/util.py
Added `type="text/javascript"` to generated `<script>` tag.
2013-02-14 09:02:30 +05:30
hotet
10b16f2ba3 Update django_select2/static/js/heavy_data.min.js
Removed comma
2013-01-24 12:00:56 +01:00
hotet
06ae211f8b Update django_select2/static/js/heavy_data.js
Removed comma :<
2013-01-24 11:59:36 +01:00
AppleGrew (applegrew)
322fc67759 Major typo. Regression in widgets. 2013-01-19 17:30:04 +05:30
AppleGrew (applegrew)
709c58fca2 Added type directive in docstring for userGetValTextFuncName. 2013-01-16 00:12:32 +05:30
AppleGrew (applegrew)
ebdc72b9f4 Docstring indent 2013-01-16 00:02:00 +05:30
AppleGrew (applegrew)
842e1ac8f8 Correcting doc string directive. 2013-01-15 23:56:42 +05:30
AppleGrew (applegrew)
97b8dac054 Formatting fix in docstring 2013-01-15 23:39:11 +05:30
AppleGrew (applegrew)
1aedde99d6 Now minifying CSS and JS files. During production they will be used intead.
The minification process has been automated too. When sdist command is
given to setup.py then it will use web-service to minify the js n css
files.
2013-01-13 23:25:47 +05:30
AppleGrew (applegrew)
3fb6581737 Heavy no longer has any need for caching user selections in cookies or localStorage. 2013-01-13 10:58:52 +05:30
AppleGrew (applegrew)
aa60bb36ec Making heavy use localStorage instead of cookies and few more heavy related fixes. 2013-01-13 10:02:39 +05:30
AppleGrew (applegrew)
8dea1a6446 Addressed issue#19.
Code to generate JS code did not take into account the scenario where
string constants already had quotes in them. Only Heavy fields and
widgets were affected.
2013-01-06 00:30:02 +05:30
AppleGrew (applegrew)
ec8f815b9c v3.1.5 2012-12-18 09:54:55 +05:30
Stefan Foulis
fdbf724761 adds extra_data support for AutoModelSelect2Field
allows passing data structures in ajax requests that can be used for custom formatting
2012-12-13 14:20:08 +01:00
AppleGrew (applegrew)
913453f8ef v3.1.4. Manually picked changes from Issue#16 (pull request). 2012-11-27 10:31:40 +05:30
AppleGrew (applegrew)
cf960fe11b v3.1.3 released. 2012-11-26 23:17:15 +05:30
AppleGrew (applegrew)
7946563288 v3.1.3. Fixed some minor issues. 2012-11-25 01:44:36 +05:30
AppleGrew (applegrew)
434f89cdfc Performace improvement & tests 2012-11-25 00:32:56 +05:30
Stéphane Raimbault
d24b6a5206 Pylint and useless imports
widgets.py contains DOS and Unix line returns, I've converted it
to DOS only to keep changes small in this commit.
2012-11-09 18:20:32 +01:00
AppleGrew (applegrew)
487e55020c Added a timer util. 2012-10-13 20:56:39 +05:30
AppleGrew (applegrew)
be760d69c0 Version 3.1.2 doc n version no. update 2012-10-04 23:23:21 +05:30
AppleGrew (applegrew)
1e166c7e8f Let Django_select2 be imported even when Django is not installed. 2012-10-02 21:07:47 +05:30
AppleGrew (applegrew)
0d40026fe0 Doc updates. 2012-09-29 01:32:21 +05:30
AppleGrew (applegrew)
34c9f4383d Removed an unwanted file. 2012-09-28 23:30:59 +05:30
AppleGrew (applegrew)
3ac09c7a96 * Fixed setup.py to include templates dir * Updated select2 to version 3.2 2012-09-28 23:26:12 +05:30
AppleGrew (applegrew)
6409289bbb Added AUTO_RENDER_SELECT2_STATICS setting. 2012-09-14 12:04:36 +05:30
AppleGrew (applegrew)
18856a8e1a Doc update 2012-09-10 12:02:58 +05:30
AppleGrew (applegrew)
8ba04e5e4a Doc updates 2012-09-05 12:16:48 +05:30
AppleGrew (applegrew)
b64e80d072 Doc updates. Updating Select2 JS to 3.1 2012-09-03 23:51:18 +05:30
AppleGrew (applegrew)
94bc993377 Further bug fixes. 2012-09-03 09:39:50 +05:30
AppleGrew (applegrew)
3c3fe0b130 Fixing some design issues in Heavy fields. 2012-09-02 01:21:17 +05:30
AppleGrew (applegrew)
3f65a2349f Issue4, more fixes. 2012-09-01 01:17:08 +05:30
Nirupam Biswas
7152641ab5 Some docstring fixes. 2012-08-31 18:20:56 +05:30
AppleGrew (applegrew)
8169db806b * Sphinx docs added. * Fixed Issue 4 * Improved code docstrings 2012-08-31 11:34:23 +05:30
AppleGrew (applegrew)
4479cfbdf7 Better fix for registering field_id 2012-08-23 01:16:40 +05:30
AppleGrew (applegrew)
4e240ce415 v2.0.1
* Auto field register fix.
* Prevent multiple execution of heavy_data.js.
2012-08-23 00:22:49 +05:30
AppleGrew (applegrew)
878ddb839a More bug fixes. And added 'auto_id' parameter for auto fields. 2012-08-22 11:19:30 +05:30
AppleGrew (applegrew)
6a2c96668d Loggers added 2012-08-22 09:55:20 +05:30
AppleGrew (applegrew)
2c2a0073f5 Added example section in Readme 2012-08-21 23:45:06 +05:30
AppleGrew (applegrew)
691fa14e2e Multi value bu fixes
Many bugs ironed out of Multi value fields. Added many new tests for
multi value fields.
2012-08-21 23:21:41 +05:30
AppleGrew (applegrew)
0e0b21119d Updated AutoView mixin 2012-08-21 01:48:55 +05:30
AppleGrew (applegrew)
f3569bcea2 Multi value tests added and more fixes.
* Fixed infinite recursion causing Python crash bug.
* Multi-value is working.
* Tested added for multi-value field.
2012-08-21 01:38:31 +05:30
AppleGrew (applegrew)
703d540689 The changes in this code crashes Python 2.7.1 (OSX build) 2012-08-20 19:08:52 +05:30
AppleGrew (applegrew)
8579993107 v1.1 changes.
Lots of fixes and redesign. Also added a full fledged project for
testing out the components.
2012-08-19 23:13:15 +05:30
AppleGrew (applegrew)
14fa11836d Generated <select> code can have unicode text. 2012-08-13 20:23:00 +05:30
AppleGrew (applegrew)
18249afbeb Upgrading Select2 to 2.3.0 2012-08-12 21:55:23 +05:30
AppleGrew (applegrew)
48ce0b5703 Some fix for setup. 2012-08-05 15:18:27 +05:30
AppleGrew (applegrew)
d5aa9b5ddb Enhanced Heavy fields. Added 'auto' fields. Some bug fixes. 2012-08-05 13:00:44 +05:30
AppleGrew (applegrew)
243c614c3a Removed some invalid code 2012-07-24 01:51:15 +05:30
AppleGrew (applegrew)
30082bb8ed Initial commit 2012-07-24 01:44:55 +05:30