Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved misplaced documentation warning note about internal QuerySet qu…

…ery atribute.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17342 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 33f839b252b26922841a11836785a6826bb459a6 1 parent 8312b85
@ramiro ramiro authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 docs/ref/models/querysets.txt
View
12 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
Please sign in to comment.
Something went wrong with that request. Please try again.