diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 11e23c0250..76335550ae 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -1752,6 +1752,12 @@ The above code fragment could also be written as follows:: inner_q = Blog.objects.filter(name__contains='Cheddar').values('pk').query entries = Entry.objects.filter(blog__in=inner_q) +.. warning:: + + This ``query`` attribute should be considered an opaque internal attribute. + It's fine to use it like above, but its API may change between Django + versions. + This second form is a bit less readable and unnatural to write, since it accesses the internal ``query`` attribute and requires a ``ValuesQuerySet``. If your code doesn't require compatibility with Django 1.0, use the first @@ -1772,12 +1778,6 @@ extract two field values, where only one is expected:: inner_qs = Blog.objects.filter(name__contains='Ch').values('name', 'id') entries = Entry.objects.filter(blog__name__in=inner_qs) -.. warning:: - - This ``query`` attribute should be considered an opaque internal attribute. - It's fine to use it like above, but its API may change between Django - versions. - .. admonition:: Performance considerations Be cautious about using nested queries and understand your database