summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorRomain Garrigues <romain.garrigues@makina-corpus.com>2016-07-06 14:28:37 +0100
committerTim Graham <timograham@gmail.com>2016-07-06 09:28:51 -0400
commit8976d08edbf34289b1d1dc5be02d15634b96c266 (patch)
tree6c37cf747b34c68742e17433ae41a107f3e65667 /docs/ref/models
parent87940f1f3c5cebdee5b90182f55bb138d8232778 (diff)
[1.10.x] Fixed #25461 -- Corrected meta API code examples to account for MTI.
In the case of multiple-table inheritance models, get_all_related_objects() and get_all_related_objects_with_model() don't return the auto-created OneToOneField, but the new examples didn't account for this. Backport of 8be84e2ac42b2556fd6fa07794b3708b143ef341 from master
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/meta.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/ref/models/meta.txt b/docs/ref/models/meta.txt
index 36533e36af..b63305d427 100644
--- a/docs/ref/models/meta.txt
+++ b/docs/ref/models/meta.txt
@@ -215,7 +215,8 @@ can be made to convert your code to the new API:
[
f for f in MyModel._meta.get_fields()
- if (f.one_to_many or f.one_to_one) and f.auto_created
+ if (f.one_to_many or f.one_to_one)
+ and f.auto_created and not f.concrete
]
* ``MyModel._meta.get_all_related_objects_with_model()`` becomes::
@@ -223,7 +224,8 @@ can be made to convert your code to the new API:
[
(f, f.model if f.model != MyModel else None)
for f in MyModel._meta.get_fields()
- if (f.one_to_many or f.one_to_one) and f.auto_created
+ if (f.one_to_many or f.one_to_one)
+ and f.auto_created and not f.concrete
]
* ``MyModel._meta.get_all_related_many_to_many_objects()`` becomes::