Refs #26230 -- Removed support for model name query lookups when using Meta.default_related_name.

Per deprecation timeline.
This commit is contained in:
Tim Graham 2016-12-31 11:24:40 -05:00
parent 2d7fb77987
commit bfe0d54514
4 changed files with 7 additions and 50 deletions

View file

@ -130,30 +130,6 @@ Django quotes column and table names behind the scenes.
and the name of the model, both lowercased. See the paragraph on
:ref:`related names for abstract models <abstract-related-name>`.
.. deprecated:: 1.10
This attribute now affects ``related_query_name``. The old query lookup
name is deprecated::
from django.db import models
class Foo(models.Model):
pass
class Bar(models.Model):
foo = models.ForeignKey(Foo)
class Meta:
default_related_name = 'bars'
::
>>> bar = Bar.objects.get(pk=1)
>>> # Using model name "bar" as lookup string is deprecated.
>>> Foo.objects.get(bar=bar)
>>> # You should use default_related_name "bars".
>>> Foo.objects.get(bars=bar)
``get_latest_by``
-----------------