Commit graph

24 commits

Author SHA1 Message Date
superqwer
bd761ec197 relative import fix 2015-04-06 15:58:42 +03:00
Johannes Hoppe
bd40acc761 Added six types and fixed setup 2015-03-31 10:22:03 +02:00
Johannes Hoppe
2cfbfd3325 Code cleanup -- Added pep8 tests for package. 2015-03-30 10:19:37 +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
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
Eugene Morozov
b4feb53ea4 Do not assume that jQuery is bound to $ variable. 2013-10-07 22:03:00 +05:30
AppleGrew (applegrew)
12ad5255d0 Bumping Select2 JS version to 3.4.2. 2013-09-15 13:38:41 +05:30
AppleGrew (applegrew)
e082822cdd v4.0.0 Added Hashed Id generation scheme 2013-03-15 11:30:40 +05:30
AppleGrew (applegrew)
05b69c89b6 * Multi-process support. * Updated Select2 to 3.3.1. 2013-03-02 11:25:00 +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
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)
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)
3c3fe0b130 Fixing some design issues in Heavy fields. 2012-09-02 01:21:17 +05:30
AppleGrew (applegrew)
8169db806b * Sphinx docs added. * Fixed Issue 4 * Improved code docstrings 2012-08-31 11:34:23 +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)
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)
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)
d5aa9b5ddb Enhanced Heavy fields. Added 'auto' fields. Some bug fixes. 2012-08-05 13:00:44 +05:30