Commit graph

651 commits

Author SHA1 Message Date
Jacek Tomaszewski
6844acdbdb Merge pull request #267 from wrwrwr/fix-tabbed-admin-with-two-jqueries
Make tabbed admin work with two jQueries (fixed javascript scoping issue).
2014-10-04 19:30:05 +02:00
wrwrwr
6026a91741 A more elegant solution suggested by zlorf. 2014-10-04 19:16:18 +02:00
wrwrwr
b06e49921b Fixed shadowing of jQuery referenced by a global `jQuery variable by django.jQuery`
in the tabbed admin script.

Javascript has a nasty semantic of moving initializers to the beginning of a block, thus
rewritting ``var a = a || b`` as ``var a; a = a || b``. With such a code, if ``a`` starts
as a global variable with some value, you could think that it would end up having the same
value, but it is actually first set to ``undefined`` at the beginning of the block and
then always set to ``b`` in the statement [1][2].

This is mostly of importance if you actually have more than one jQuery loaded.
For instance, this happens with Mezzanine -- first Grappelli-safe loads a copy, and calls
``$.noConflict`` thus storing its version as ``jQuery``, second is Django, loading another
copy and calling ``django.jQuery = jQuery.noConflict(true)``. So far so good, we have one
copy on ``jQuery`` and another on ``django.jQuery``; jQuery UI chooses to load itself onto
the ``jQuery`` (Grappelli) copy. But now runs the tabbed_translation_fields script, hiding
the jQuery with UI loaded at the very beggining of the first block, and a moment later
complaining that ``.tabs()`` or something else is not defined.

[1]: http://www.ecma-international.org/ecma-262/5.1/#sec-12.2 (note the first paragraph after the grammar)
[2]: http://stackoverflow.com/questions/500431/what-is-the-scope-of-variables-in-javascript (point 8)
2014-10-04 17:52:21 +02:00
Jacek Tomaszewski
706757739d Use Django 1.7 final release in tests. 2014-09-07 21:52:05 +02:00
Jacek Tomaszewski
8047a4dcda Add empty MIDDLEWARE_CLASSES to test settings in order to disable system check warning. 2014-09-07 21:43:58 +02:00
Jacek Tomaszewski
395771d227 Patch db_column of translation fields in migration files (close #264). 2014-09-07 21:42:05 +02:00
Jacek Tomaszewski
e59cf5a4cd Readd GenericIp field support and tests as we now require Django >= 1.4. 2014-08-02 16:42:14 +02:00
Jacek Tomaszewski
19c2a90e9f Add fallback to values and values_list (close #258). 2014-07-29 17:42:17 +03:00
Dirk Eschler
42c949ddb5 Changed Django to 1.7c2. 2014-07-28 12:03:16 +02:00
deschler
59317a4c12 Consistent use of django version check. 2014-07-28 00:03:50 +02:00
deschler
bc498f68d6 Removed superfluous do's from private api. 2014-07-27 23:53:30 +02:00
deschler
89e372a743 Added list_editable test. 2014-07-27 22:28:45 +02:00
deschler
de26e702a7 Added migrations (Django 1.7) documentation. 2014-07-27 02:33:26 +02:00
deschler
e91f7f1dd6 Added line about about coveralls and included shields in contribute chapter. 2014-07-27 00:52:18 +02:00
deschler
8a35f82477 Added coveralls shield. 2014-07-26 01:27:55 +02:00
deschler
3bf2a1f717 Hooked in coveralls for test coverage. 2014-07-26 01:17:17 +02:00
deschler
c5839bc019 Added PyPI shields and used flat style. 2014-07-26 00:28:58 +02:00
deschler
756de544aa General documentation improvements. 2014-07-20 01:58:00 +02:00
Dirk Eschler
ca453533e4 Prepared 0.8b2 release. 2014-07-18 10:57:55 +02:00
Jacek Tomaszewski
1f419ee5f4 Fix dict iteration Exception under Python3 (close #256). 2014-07-16 09:47:17 +02:00
Dirk Eschler
3281547a9e Respect null option of TranslationField in migrations. 2014-07-14 11:07:17 +02:00
Jacek Tomaszewski
c4d6c82f95 Fix six import (ref #253). 2014-07-11 15:04:03 +02:00
Dirk Eschler
3e53ec2be1 Indicated Python 3.4 support (close #254). 2014-07-11 14:44:16 +02:00
Dirk Eschler
f7acd8a688 Used six compatibility layer (ref #253). 2014-07-11 14:40:38 +02:00
Dirk Eschler
ee32cce0c2 Added Python 3.4 and changed Django to 1.7rc1 (ref #254). 2014-07-11 13:53:31 +02:00
Dirk Eschler
fd911bb37b Fixed unicode call in deconstruct to maintain Python3 compatibility. 2014-07-11 13:31:57 +02:00
Dirk Eschler
e4e325a8e7 Fixed translation fields in migrations don't include language code (close #253). 2014-07-11 12:37:41 +02:00
Jacek Tomaszewski
5b2492cdc0 Fix reduce usage under Python3. 2014-07-10 09:43:49 +02:00
Jacek Tomaszewski
17f3d96ccc Rewrite spanned queries on all levels for defer/only (close #248).
Also:
- optimize fields to related model access
- more elegant way to access DefferedModel real class
- fix select_related rewriting and add some code to contemplate possible solutions
- update docs about select_related
- add 2 test for implemented features
2014-07-09 23:19:48 +02:00
Jacek Tomaszewski
7a7b3fbc3b Rewrite field names in select_related; fix deffered models registry lookup (close #248). 2014-07-06 19:36:46 +02:00
Jacek Tomaszewski
58e06c464d Fix MultilingualManager MRO (close #204). 2014-07-06 14:39:53 +02:00
Jacek Tomaszewski
011d39f32f Add docs section about debug toolbar. 2014-06-30 21:39:20 +02:00
Jacek Tomaszewski
8e10664745 Support AppConfigs in INSTALLED_APPS (close #252).
Thanks Warnar Boekkooi for initial commit.
2014-06-24 20:10:47 +02:00
Jacek Tomaszewski
9f10ee4ef1 Update changelog for 0.8b1. 2014-06-22 14:20:51 +02:00
deschler
3dcffd7f1b Removed classifier for Python 2.5 which is no longer supported. 2014-06-22 13:53:09 +02:00
deschler
7dcd7790d7 Required Django >=1.4. 2014-06-22 13:51:47 +02:00
deschler
c607ed3862 Prepared 0.8b1 release. 2014-06-22 13:43:07 +02:00
Jacek Tomaszewski
41f8c68ed4 Update docs; fix type coercion. 2014-06-21 23:36:01 +02:00
Jacek Tomaszewski
ad2985b0bf Update docs about 1.7 compatibility and bumb the version to 0.8a (close #237). 2014-06-09 23:40:25 +02:00
Jacek Tomaszewski
973bb78bda Fix Django 1.7 DeprecationWarnings. 2014-06-09 23:32:22 +02:00
Jacek Tomaszewski
7b5e0938a7 Adapt MultilingualManager to use new Lookups from Django 1.7. 2014-06-09 23:32:22 +02:00
Jacek Tomaszewski
2cd9467716 Fix ProxyModel handling. 2014-06-09 23:32:22 +02:00
Jacek Tomaszewski
5c014bfd0b Update build configurations. 2014-06-09 23:32:21 +02:00
Jacek Tomaszewski
ad48582270 Fix tests to work with Django 1.7. 2014-06-09 23:32:21 +02:00
Jacek Tomaszewski
6b8c429921 Add deconstruct() to field definition. 2014-06-09 23:19:54 +02:00
deschler
9c876b3fde Setup django in runtests standalone script for Django 1.7. 2014-06-09 23:19:54 +02:00
deschler
4efc7ad6c6 Added note about INSTALLED_APPS order when admin is used. 2014-06-09 23:19:54 +02:00
deschler
d488d8c488 Support AppConfig introduced by Django 1.7. 2014-06-09 23:19:35 +02:00
Jacek Tomaszewski
c89aac29fa Remove unused import. 2014-06-09 00:00:50 +02:00
Jacek Tomaszewski
0dd826547b Fixed sync_translation_fields to be compatible with Postgresql (close #247). 2014-06-05 22:53:35 +02:00