summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-10-24 00:28:39 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-10-24 00:28:39 +0000
commitb79702b2deec4ca3c625e5bffe46fa976c3c4e5f (patch)
tree2031b1d908ca03f650669b04effee8a872632e86 /docs/ref/models
parent9f70783b149105dfd37027504976f9526caeeae0 (diff)
Fixed #11402: added a `QuerySet.exists()` method. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11646 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/querysets.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index efd7c549b8..e685472cca 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -1114,6 +1114,17 @@ Aggregation <topics-db-aggregation>`.
.. _field-lookups:
+``exists()``
+~~~~~~~~~~~~
+
+.. versionadded:: 1.2
+
+Returns ``True`` if the :class:`QuerySet` contains any results, and ``False``
+if not. This tries to perform the query in the simplest and fastest way
+possible, but it *does* execute nearly the same query. This means that calling
+:meth:`QuerySet.exists()` is faster that ``bool(some_query_set)``, but not by
+a large degree.
+
Field lookups
-------------