Commit Graph

1881 Commits

Author SHA1 Message Date
Tim Graham c7d0ff0cad Fixed #20989 -- Removed explicit list comprehension inside dict() and tuple()
Thanks jeroen.pulles at redslider.net for the suggestion and
helper script.
2013-08-29 12:11:03 -04:00
Tim Graham f19a3669b8 Fixed #14786 -- Fixed get_db_prep_lookup calling get_prep_value twice if prepared is False.
Thanks homm for the report and Aramgutang and lrekucki for work on
the patch.
2013-08-29 11:13:34 -04:00
Claude Paroz 169637649b Fixed #20984 -- Stopped decoding bytes in sqlite3 adapter on Python 3
Thanks lvella at gmail.com for the report.
2013-08-29 08:39:06 +02:00
Andrew Godwin 35230adf63 Python 3 compat fix for callable() 2013-08-23 17:59:35 +01:00
Andrew Godwin 2787de652a Fix location of tablespace clauses in schema backend column SQL 2013-08-23 14:38:55 +01:00
Andrew Godwin 5569b0b92f Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/backends/oracle/base.py
	django/db/backends/postgresql_psycopg2/base.py
	django/db/models/signals.py
	tests/queries/tests.py
2013-08-23 12:36:53 +01:00
Andrew Godwin 9cc6cfc405 Fix Oracle's default handling and schema-prepared-statement issue 2013-08-23 12:07:55 +01:00
Anssi Kääriäinen 6af05e7a0f Fixed model.__eq__ and __hash__ for no pk value cases
The __eq__ method now considers two instances without primary key value
equal only when they have same id(). The __hash__ method raises
TypeError for no primary key case.

Fixed #18864, fixed #18250

Thanks to Tim Graham for docs review.
2013-08-22 17:24:07 +03:00
Tim Graham 768bbf3efe Revert "Fixed #20956 -- Removed useless check in django.db.utils"
This reverts commit ce0e86cf76.

The check is necessary if 'ENGINE' is an empty string.
Thanks apollo13 for pointing this out.
2013-08-22 09:47:17 -04:00
Dima Kurguzov ce0e86cf76 Fixed #20956 -- Removed useless check in django.db.utils 2013-08-22 08:53:14 -04:00
Anssi Kääriäinen 8d65b6082c Fixed #20955 -- select_related regression
In cases where the same connection (from model A to model B along the
same field) was needed multiple times in a select_related query, the
join setup code mistakenly reused an existing join.
2013-08-22 10:51:07 +03:00
Tim Graham 3f416f6379 Fixed a regression with get_or_create and virtual fields.
refs #20429

Thanks Simon Charette for the report and review.
2013-08-21 22:32:04 +01:00
Anssi Kääriäinen 244e2b71f5 Fixed #20946 -- model inheritance + m2m failure
Cleaned up the internal implementation of m2m fields by removing
related.py _get_fk_val(). The _get_fk_val() was doing the wrong thing
if asked for the foreign key value on foreign key to parent model's
primary key when child model had different primary key field.
2013-08-21 22:32:04 +01:00
Simon Charette 1db5fce1ee Oracle also treats NULLs as largests values when ordering. 2013-08-21 22:32:03 +01:00
Anssi Kääriäinen f5552571dc Fixed #20820 -- Model inheritance + m2m fixture loading regression
Tests by Tim Graham, report from jeroen.pulles@redslider.net.
2013-08-21 22:31:50 +01:00
Anssi Kääriäinen ced3e6b17d Fixed test failure caused by different NULL ordering between backends 2013-08-21 22:31:50 +01:00
Anssi Kääriäinen cea7204504 Fixed #14056 -- Made sure LEFT JOIN aren't trimmed in ORDER BY
If LEFT JOINs are required for correct results, then trimming the join
can lead to incorrect results. Consider case:

TBL A: ID | TBL B: ID  A_ID
       1           1   1
       2
Now A.order_by('b__a') did use a join to B, and B's a_id column. This
was seen to contain the same value as A's id, and so the join was
trimmed. But this wasn't correct as the join is LEFT JOIN, and for row
A.id = 2 the B.a_id column is NULL.
2013-08-21 22:30:46 +01:00
Simon Charette 63378163f9 Fixed #20943 -- Weakly reference senders when caching their associated receivers 2013-08-21 22:30:45 +01:00
Andrew Godwin 2e7f45a372 Change autodetector changes API to be just one method 2013-08-21 22:25:15 +01:00
Tim Graham f7290581fe Fixed a regression with get_or_create and virtual fields.
refs #20429

Thanks Simon Charette for the report and review.
2013-08-21 08:30:21 -04:00
Anssi Kääriäinen b065aeb17f Fixed #20946 -- model inheritance + m2m failure
Cleaned up the internal implementation of m2m fields by removing
related.py _get_fk_val(). The _get_fk_val() was doing the wrong thing
if asked for the foreign key value on foreign key to parent model's
primary key when child model had different primary key field.
2013-08-21 08:32:19 +03:00
Simon Charette 859e678b3d Oracle also treats NULLs as largests values when ordering. 2013-08-20 12:28:59 -04:00
Anssi Kääriäinen 1ed77e7782 Fixed #20820 -- Model inheritance + m2m fixture loading regression
Tests by Tim Graham, report from jeroen.pulles@redslider.net.
2013-08-20 16:54:05 +03:00
Anssi Kääriäinen 8dc76c4b91 Fixed test failure caused by different NULL ordering between backends 2013-08-20 11:33:44 +03:00
Anssi Kääriäinen 905409855c Fixed #14056 -- Made sure LEFT JOIN aren't trimmed in ORDER BY
If LEFT JOINs are required for correct results, then trimming the join
can lead to incorrect results. Consider case:

TBL A: ID | TBL B: ID  A_ID
       1           1   1
       2
Now A.order_by('b__a') did use a join to B, and B's a_id column. This
was seen to contain the same value as A's id, and so the join was
trimmed. But this wasn't correct as the join is LEFT JOIN, and for row
A.id = 2 the B.a_id column is NULL.
2013-08-20 10:55:00 +03:00
Simon Charette e55ca60903 Fixed #20943 -- Weakly reference senders when caching their associated receivers 2013-08-20 01:53:58 -04:00
Andrew Godwin b6a957f0ba Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	docs/ref/django-admin.txt
2013-08-19 18:30:48 +01:00
Anssi Kääriäinen 7bc57a6d71 Fixed #11881 -- removed junk from aggregation subqueries
There were clauses that weren't needed in the subqueries. These were
ORDER BY, SELECT FOR UPDATE and related selections.
2013-08-19 16:15:09 +03:00
Anssi Kääriäinen 7737305a4f Fixed #12886 -- aggregation over sliced queryset 2013-08-19 16:00:17 +03:00
Andrew Godwin 52edc16086 Add more stringent M2M tests and fix the bug they exposed 2013-08-19 13:50:26 +01:00
Andrew Godwin 5b522cd85a Minor oracle fixes 2013-08-19 13:12:48 +01:00
Anssi Kääriäinen 4668c142dc Made Model.__eq__ consider proxy models equivalent
Fixed #11892, fixed #16458, fixed #14492.
2013-08-19 09:51:28 +03:00
Harm Geerts 240886183b Fixed #20829 -- Skip postgis metadata tables with introspection 2013-08-16 21:14:29 +02:00
Andrew Godwin 157604a87f Oracle schema backend, passes most tests and is pretty complete. 2013-08-13 20:54:57 +01:00
Loic Bistuer 163a34ce4b Fixed #20883 -- Made model inheritance find parent links in abstract parents 2013-08-13 15:14:11 +03:00
Anssi Kääriäinen dcdc579d16 Fixed #20874 -- bump_prefix() in nested subqueries
Also made some cleanup to build_filter() code by introducing submethods
solve_lookup_type() and prepare_lookup_value().
2013-08-13 14:11:52 +03:00
Andrew Godwin 44f907dd98 Start of getting Oracle to do schema stuff 2013-08-12 20:05:20 +01:00
Andrew Godwin b61b634628 Fix weird planning issues when already fully migrated. 2013-08-11 15:28:51 +01:00
Andrew Godwin b4c493ecd3 Remove keep_default from add_field 2013-08-11 14:28:55 +01:00
Andrew Godwin d985fd7a18 Fix tablespace command 2013-08-11 14:27:42 +01:00
Andrew Godwin ae19315b4d Support index_together during model creation 2013-08-11 14:23:31 +01:00
Andrew Godwin 21be9fef7b Stop being overcautious about Field.rel 2013-08-11 00:01:30 +01:00
Andrew Godwin 7702819441 Update get_constraints with better comments 2013-08-10 23:58:12 +01:00
Andrew Godwin 7970d97a70 Docs tweaks (thanks timgraham) 2013-08-10 20:00:12 +01:00
Andrew Godwin f093646bfc Remove pointless comment. 2013-08-09 17:47:13 +01:00
Andrew Godwin 9b4a789eef Add [y/n] to autodetector questions and allow for default value 2013-08-09 17:45:19 +01:00
Andrew Godwin ae96ad872f Remove pointless fetch_results param 2013-08-09 17:42:56 +01:00
Andrew Godwin fb16ee5a31 Remove commented-out print 2013-08-09 17:41:39 +01:00
Andrew Godwin 9f73629420 utils.importlib is deprecated 2013-08-09 17:36:16 +01:00
Andrew Godwin 588b523233 Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/models/options.py
2013-08-09 14:37:37 +01:00