| Age | Commit message (Collapse) | Author |
|
The option can be used to force pre 1.6 style SELECT on save behaviour.
This is needed in case the database returns zero updated rows even if
there is a matching row in the DB. One such case is PostgreSQL update
trigger that returns NULL.
Reviewed by Tim Graham.
Refs #16649
|
|
|
|
Thanks jeroen.pulles at redslider.net for the suggestion and
helper script.
|
|
prepared is False.
Thanks homm for the report and Aramgutang and lrekucki for work on
the patch.
|
|
Conflicts:
django/db/backends/oracle/base.py
django/db/backends/postgresql_psycopg2/base.py
django/db/models/signals.py
tests/queries/tests.py
|
|
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.
|
|
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.
|
|
refs #20429
Thanks Simon Charette for the report and review.
|
|
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.
|
|
Tests by Tim Graham, report from jeroen.pulles@redslider.net.
|
|
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.
|
|
|
|
refs #20429
Thanks Simon Charette for the report and review.
|
|
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.
|
|
Tests by Tim Graham, report from jeroen.pulles@redslider.net.
|
|
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.
|
|
|
|
Conflicts:
docs/ref/django-admin.txt
|
|
There were clauses that weren't needed in the subqueries. These were
ORDER BY, SELECT FOR UPDATE and related selections.
|
|
|
|
|
|
Fixed #11892, fixed #16458, fixed #14492.
|
|
|
|
Also made some cleanup to build_filter() code by introducing submethods
solve_lookup_type() and prepare_lookup_value().
|
|
Conflicts:
django/db/models/options.py
|
|
Thanks hvendelbo for the suggestion and koenb for the draft patch.
|
|
Conflicts:
django/core/management/commands/flush.py
django/core/management/commands/syncdb.py
django/db/models/loading.py
docs/internals/deprecation.txt
docs/ref/django-admin.txt
docs/releases/1.7.txt
|
|
The bug was already fixed by 01b9c3d5193fe61b82ae8b26242a13fdec22f211,
so only tests added.
At the same time promote_joins()'s uncoditional flag is gone, it isn't
needed for anything any more.
|
|
|
|
the first try
Thanks ea2100@ for the report and akaariai for the patch.
|
|
Thanks Loic Bistuer for the review.
|
|
|
|
list of choices.
|
|
|
|
|
|
The change also removed allow_explicit_fk from sql/query.py.
|
|
All Promise objects were passed to force_text() deep in ORM query code.
Not only does this make it difficult or impossible for developers to
prevent or alter this behaviour, but it is also wrong for non-text
fields.
This commit changes `Field.get_prep_value()` from a no-op to one that
resolved Promise objects. All subclasses now call super() method first
to ensure that they have a real value to work with.
|
|
|
|
Should be unneeded with Python 2.7 and up.
Added some unicode_literals along the way.
|
|
This was a shim for pre-Python 2.7 support.
|
|
|
|
It has been possible to use models of wrong type in related field
lookups. For example pigs__in=[a_duck] has worked. Changes to
ForeignObject broke that.
It might be a good idea to restrict the model types usable in lookups.
This should be done intentionally, not accidentally and without any
consideration for deprecation path.
|
|
Additionally this patch solves the orthogonal problem that specialized
`QuerySet` like `ValuesQuerySet` didn't inherit from the current `QuerySet`
type. This wasn't an issue until now because we didn't officially support
custom `QuerySet` but it became necessary with the introduction of this new
feature.
Thanks aaugustin, akaariai, carljm, charettes, mjtamlyn, shaib and timgraham
for the reviews.
|
|
|
|
Thanks al_the_x for the report and fheinz for the draft patch.
|
|
|
|
refs #20761
|
|
update_or_create.
|
|
Refs #20611.
|
|
In the combination of .values().aggregate() the aggregate_select_mask
didn't include the aggregates added. This resulted in bogus query.
Thanks to Trac alias debanshuk for report.
|