Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a note about queryset.query being opaque.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8955 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7c2e2d2b5e58d47a26de6487cbe77b4d5ace6614 1 parent 9d407fb
@jacobian jacobian authored
Showing with 8 additions and 14 deletions.
  1. +8 −14 docs/ref/models/querysets.txt
View
22 docs/ref/models/querysets.txt
@@ -939,7 +939,14 @@ instead of providing a list of literal values. The queryset must be
reduced to a list of individual values using the ``values()`` method,
and then converted into a query using the ``query`` attribute::
- Entry.objects.filter(blog__in=Blog.objects.filter(name__contains='Cheddar').values('pk').query)
+ q = Blog.objects.filter(name__contains='Cheddar').values('pk').query
+ e = Entry.objects.filter(blog__in=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 queryset will be evaluated as subselect statement::
@@ -973,19 +980,6 @@ lte
Less than or equal to.
-in
-~~
-
-In a given list.
-
-Example::
-
- Entry.objects.filter(id__in=[1, 3, 4])
-
-SQL equivalent::
-
- SELECT ... WHERE id IN (1, 3, 4);
-
startswith
~~~~~~~~~~
Please sign in to comment.
Something went wrong with that request. Please try again.