1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #19173 -- Made EmptyQuerySet a marker class only

The guarantee that no queries will be made when accessing results is
done by new EmptyWhere class which is used for query.where and having.

Thanks to Simon Charette for reviewing and valuable suggestions.
This commit is contained in:
Anssi Kääriäinen
2012-10-24 00:04:37 +03:00
parent a843539af2
commit a2396a4c8f
11 changed files with 96 additions and 177 deletions

View File

@@ -31,6 +31,11 @@ Minor features
Backwards incompatible changes in 1.6
=====================================
* The ``django.db.models.query.EmptyQuerySet`` can't be instantiated any more -
it is only usable as a marker class for checking if
:meth:`~django.db.models.query.QuerySet.none` has been called:
``isinstance(qs.none(), EmptyQuerySet)``
.. warning::
In addition to the changes outlined in this section, be sure to review the