django-select2/django_select2
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
..
static/django_select2 updated minified versions of static files 2015-04-28 19:53:05 +03:00
templatetags Fixed import order 2015-04-02 18:54:08 +02:00
__init__.py doc: fix typos/grammar 2015-06-08 11:35:09 +02:00
db_client.py Code cleanup -- Added pep8 tests for package. 2015-03-30 10:19:37 +02:00
fields.py Added six for metaclasses 2015-04-10 10:15:20 +02:00
media.py return list of css links instead of generator 2015-05-05 15:59:16 +03:00
memcache_client.py Added six types and fixed setup 2015-03-31 10:22:03 +02:00
memcache_wrapped_db_client.py relative import fix 2015-04-06 15:58:42 +03:00
models.py django1.8 compatibility issues 2015-04-06 16:31:23 +03:00
urls.py Code cleanup -- Added pep8 tests for package. 2015-03-30 10:19:37 +02:00
util.py relative import fix 2015-04-06 15:58:42 +03:00
views.py Removed method check because it done by dispatch 2015-04-10 10:16:01 +02:00
widgets.py Made widget media a dynamic property 2015-06-19 14:49:51 +02:00