summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-10-29 18:56:57 -0400
committerTim Graham <timograham@gmail.com>2015-10-30 10:28:10 -0400
commit31a51a04e899f1fa7fa77be38e3484074d930369 (patch)
treef8fb110e59c4611f6023e09fe279361f0a285210 /docs
parent8b92839769e4cab69add65d5770f2904b457a9b6 (diff)
[1.9.x] Fixed #21422 -- Documented that prefetch_related() results must be homogeneous.
Backport of 69239c0f968ee55cb9ca1e31323fb696db0c2aec from master
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/querysets.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index ac62089bf7..25fa01421d 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -884,7 +884,10 @@ many-to-many and many-to-one objects, which cannot be done using
``select_related``, in addition to the foreign key and one-to-one relationships
that are supported by ``select_related``. It also supports prefetching of
:class:`~django.contrib.contenttypes.fields.GenericRelation` and
-:class:`~django.contrib.contenttypes.fields.GenericForeignKey`.
+:class:`~django.contrib.contenttypes.fields.GenericForeignKey`, however, it
+must be restricted to a homogeneous set of results. For example, prefetching
+objects referenced by a ``GenericForeignKey`` is only supported if the query
+is restricted to one ``ContentType``.
For example, suppose you have these models::