summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-13 00:36:57 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-13 00:36:57 +0000
commit9f0fb3dcc9d24ec1f5abb83dfb58b6da5a6d4baa (patch)
treefeed3b2ce901c56729c8218d5199a3f8f18e436a /django
parentc8b33b824b4532e0f81abeb095764b0e3ea3c2e1 (diff)
queryset-refactor: Made none() a method on Querysets, as the documentation
indicates (it was only added to managers in [4394]. Refs #6177. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/db/models/query.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 59b6e64954..76f5eab680 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -293,6 +293,12 @@ class _QuerySet(object):
return self._clone(klass=DateQuerySet, setup=True, _field=field,
_kind=kind, _order=order)
+ def none(self):
+ """
+ Returns an empty queryset.
+ """
+ return self._clone(klass=EmptyQuerySet)
+
##################################################################
# PUBLIC METHODS THAT ALTER ATTRIBUTES AND RETURN A NEW QUERYSET #
##################################################################