| Age | Commit message (Collapse) | Author |
|
|
|
Added do_not_call_in_templates=True attribute to RelatedManagers
to prevent them from being called.
Thanks jbg@ for the report.
|
|
Previously, if a database request spanned a related object manager, the
first manager encountered would cause a request to the router, and this
would bind all subsequent queries to the same database returned by the
router. Unfortunately, the first router query would be performed using
a read request to the router, resulting in bad routing information being
used if the subsequent query was actually a write.
This change defers the call to the router until the final query is acutally
made.
It includes a small *BACKWARDS INCOMPATIBILITY* on an edge case - see the
release notes for details.
Thanks to Paul Collins (@paulcollinsiii) for the excellent debugging
work and patch.
|
|
|
|
|
|
The SubfieldBase's descriptor caused an AttributeError when accessed
from the class. Introspection didn't like that.
Patch by Trac alias supervacuo.
|
|
Thanks PaulM for the suggestion and Luke Granger-Brown and
Wiktor Kołodziej for the initial patch.
|
|
|
|
Thanks malte for the report.
|
|
subclass restrictions.
Refs #18162. Thanks claudep and mjtamlyn for review.
|
|
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.
|
|
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.
|
|
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
|
|
list of choices.
|
|
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.
|
|
|
|
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.
|
|
|
|
Refs #20611.
|
|
Conflicts:
django/db/backends/mysql/introspection.py
django/db/backends/oracle/creation.py
django/db/backends/postgresql_psycopg2/creation.py
django/db/models/base.py
django/db/models/loading.py
|
|
|
|
Thanks Jeff250.
|
|
|
|
|
|
|
|
In the intervening years, RelatedField has become less of a hack (though it still is one). Anyone who wants to can re-instate the comment, but please add more details.
|
|
|
|
Thanks stanislas.guerra at gmail.com for the report and
Baptiste Mispelon for the review.
|
|
|
|
Conflicts:
django/db/backends/__init__.py
django/db/models/fields/related.py
tests/field_deconstruction/tests.py
|
|
This is to help other ongoing branches which would benefit from
this functionality.
|
|
|
|
|
|
Conflicts:
django/db/models/loading.py
|
|
fields
|
|
as the exception bubbles up
|
|
Thanks carbonXT for the report.
|
|
Conflicts:
django/db/models/fields/related.py
|
|
|
|
Thanks simon@ for the suggestion and JordanPowell
for the initial patch.
|
|
fields.
This is backward incompatible for custom form field/widgets that rely
on the hard-coded 'Hold down "Control", or "Command" on a Mac, to select
more than one.' sentence.
Application that use standard model form fields and widgets aren't
affected but need to start handling these help texts by themselves
before Django 1.8.
For more details, see the related release notes and deprecation timeline
sections added with this commit.
|
|
When a GenericRelation was defined on abstract model, queries on childs
of the abstract model didn't work. The problem was in the way fields and
in particular field.rel was copied from models to their children.
The regression was likely caused by #19385. Thanks to Gavin Wahl for
spotting the regression.
|
|
This allows the field's initial argument to be obtained so it can be
serialised to, and re-created from, a textual format.
|
|
|
|
Thanks Lennart Regebro for pointing it out.
|
|
|
|
|
|
|