diff options
| author | Johannes Dollinger <emulbreh@googlemail.com> | 2016-05-25 21:00:20 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-08-08 10:43:34 -0400 |
| commit | 46509cf13dbf049f75077981c29ef2c60b5a96ab (patch) | |
| tree | 7e9400fede5c49a2cb2efa666d8fc44d0752ad3c /django/db/models/sql | |
| parent | c002a0d39f18694f5e8a07d86684fc793b063056 (diff) | |
Moved EmpytResultSet to django.core.exceptions.
This removes the need for some inner imports.
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/__init__.py | 2 | ||||
| -rw-r--r-- | django/db/models/sql/compiler.py | 3 | ||||
| -rw-r--r-- | django/db/models/sql/datastructures.py | 6 | ||||
| -rw-r--r-- | django/db/models/sql/where.py | 2 |
4 files changed, 5 insertions, 8 deletions
diff --git a/django/db/models/sql/__init__.py b/django/db/models/sql/__init__.py index 80c12584fd..31f45eb90d 100644 --- a/django/db/models/sql/__init__.py +++ b/django/db/models/sql/__init__.py @@ -1,4 +1,4 @@ -from django.db.models.sql.datastructures import EmptyResultSet +from django.core.exceptions import EmptyResultSet from django.db.models.sql.query import * # NOQA from django.db.models.sql.subqueries import * # NOQA from django.db.models.sql.where import AND, OR diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 0b7f9e20cb..cedb140143 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -1,14 +1,13 @@ import re from itertools import chain -from django.core.exceptions import FieldError +from django.core.exceptions import EmptyResultSet, FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import OrderBy, Random, RawSQL, Ref from django.db.models.query_utils import QueryWrapper, select_related_descend from django.db.models.sql.constants import ( CURSOR, GET_ITERATOR_CHUNK_SIZE, MULTI, NO_RESULTS, ORDER_DIR, SINGLE, ) -from django.db.models.sql.datastructures import EmptyResultSet from django.db.models.sql.query import Query, get_order_dir from django.db.transaction import TransactionManagementError from django.db.utils import DatabaseError diff --git a/django/db/models/sql/datastructures.py b/django/db/models/sql/datastructures.py index 42f2d8790d..02e4f930e1 100644 --- a/django/db/models/sql/datastructures.py +++ b/django/db/models/sql/datastructures.py @@ -2,13 +2,11 @@ Useful auxiliary data structures for query construction. Not useful outside the SQL domain. """ +# for backwards-compatibility in Django 1.11 +from django.core.exceptions import EmptyResultSet # NOQA: F401 from django.db.models.sql.constants import INNER, LOUTER -class EmptyResultSet(Exception): - pass - - class MultiJoin(Exception): """ Used by join construction code to indicate the point at which a diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py index 9836da8735..c70d34f94f 100644 --- a/django/db/models/sql/where.py +++ b/django/db/models/sql/where.py @@ -2,7 +2,7 @@ Code to manage the creation and SQL rendering of 'where' constraints. """ -from django.db.models.sql.datastructures import EmptyResultSet +from django.core.exceptions import EmptyResultSet from django.utils import tree from django.utils.functional import cached_property |
