diff options
| author | Tim Graham <timograham@gmail.com> | 2015-10-29 18:56:57 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-10-30 10:28:20 -0400 |
| commit | 683b3dff7b8f02e5d5a67e678698f420cbd018e9 (patch) | |
| tree | 3e796c90edd9870f2078ff5658d1fd7d23d14e21 | |
| parent | a00bdceb43414a64cb9519f2c78900de2a025010 (diff) | |
[1.8.x] Fixed #21422 -- Documented that prefetch_related() results must be homogeneous.
Backport of 69239c0f968ee55cb9ca1e31323fb696db0c2aec from master
| -rw-r--r-- | docs/ref/models/querysets.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 5dbac1c4ae..e6b855372a 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -898,7 +898,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:: |
