summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-02-09 13:19:34 -0500
committerTim Graham <timograham@gmail.com>2015-02-09 14:24:06 -0500
commita8b70d251d238b4e6cfc7bb4296da15494f8dff3 (patch)
tree94ef5bc53e59131906aecfcf792eeac86242aa62 /django/db/models/sql
parenteb406aa686ff1809903366ef6896037af2f1f69b (diff)
[1.8.x] Sorted imports with isort; refs #23860.
Backport of 0ed7d155635da9f79d4dd67e4889087d3673c6da from master
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/aggregates.py3
-rw-r--r--django/db/models/sql/compiler.py11
-rw-r--r--django/db/models/sql/query.py29
-rw-r--r--django/db/models/sql/subqueries.py1
-rw-r--r--django/db/models/sql/where.py8
5 files changed, 26 insertions, 26 deletions
diff --git a/django/db/models/sql/aggregates.py b/django/db/models/sql/aggregates.py
index 713f530a91..0ebe10e83f 100644
--- a/django/db/models/sql/aggregates.py
+++ b/django/db/models/sql/aggregates.py
@@ -4,12 +4,11 @@ Classes to represent the default SQL aggregate functions
import copy
import warnings
-from django.db.models.fields import IntegerField, FloatField
+from django.db.models.fields import FloatField, IntegerField
from django.db.models.lookups import RegisterLookupMixin
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.functional import cached_property
-
__all__ = ['Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance']
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 8f3af37031..5c1dcf4f05 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -1,15 +1,16 @@
-from itertools import chain
import re
import warnings
+from itertools import chain
from django.core.exceptions import 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 select_related_descend, QueryWrapper
-from django.db.models.sql.constants import (CURSOR, SINGLE, MULTI, NO_RESULTS,
- ORDER_DIR, GET_ITERATOR_CHUNK_SIZE)
+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 get_order_dir, Query
+from django.db.models.sql.query import Query, get_order_dir
from django.db.transaction import TransactionManagementError
from django.db.utils import DatabaseError
from django.utils.deprecation import RemovedInDjango20Warning
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 4fb22149d0..f99b58b84f 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -6,28 +6,31 @@ themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get the information it needs.
"""
-from string import ascii_uppercase
-from itertools import count, product
-
-from collections import Mapping, OrderedDict
import copy
-from itertools import chain
import warnings
+from collections import Mapping, OrderedDict
+from itertools import chain, count, product
+from string import ascii_uppercase
from django.core.exceptions import FieldDoesNotExist, FieldError
-from django.db import connections, DEFAULT_DB_ALIAS
+from django.db import DEFAULT_DB_ALIAS, connections
from django.db.models.aggregates import Count
from django.db.models.constants import LOOKUP_SEP
from django.db.models.expressions import Col, Ref
-from django.db.models.query_utils import PathInfo, Q, refs_aggregate
-from django.db.models.sql.constants import (QUERY_TERMS, ORDER_DIR, SINGLE,
- ORDER_PATTERN, INNER, LOUTER)
+from django.db.models.query_utils import Q, PathInfo, refs_aggregate
+from django.db.models.sql.constants import (
+ INNER, LOUTER, ORDER_DIR, ORDER_PATTERN, QUERY_TERMS, SINGLE,
+)
from django.db.models.sql.datastructures import (
- EmptyResultSet, Empty, MultiJoin, Join, BaseTable)
-from django.db.models.sql.where import (WhereNode, Constraint, EverythingNode,
- ExtraWhere, AND, OR, EmptyWhere)
+ BaseTable, Empty, EmptyResultSet, Join, MultiJoin,
+)
+from django.db.models.sql.where import (
+ AND, OR, Constraint, EmptyWhere, EverythingNode, ExtraWhere, WhereNode,
+)
from django.utils import six
-from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning
+from django.utils.deprecation import (
+ RemovedInDjango19Warning, RemovedInDjango20Warning,
+)
from django.utils.encoding import force_text
from django.utils.tree import Node
diff --git a/django/db/models/sql/subqueries.py b/django/db/models/sql/subqueries.py
index be7438b2a7..78c13816d1 100644
--- a/django/db/models/sql/subqueries.py
+++ b/django/db/models/sql/subqueries.py
@@ -9,7 +9,6 @@ from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE, NO_RESULTS
from django.db.models.sql.query import Query
from django.utils import six
-
__all__ = ['DeleteQuery', 'UpdateQuery', 'InsertQuery', 'AggregateQuery']
diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py
index 6a03210a93..2ba6ceac33 100644
--- a/django/db/models/sql/where.py
+++ b/django/db/models/sql/where.py
@@ -4,18 +4,16 @@ Code to manage the creation and SQL rendering of 'where' constraints.
import collections
import datetime
-from itertools import repeat
import warnings
+from itertools import repeat
from django.conf import settings
from django.db.models.fields import DateTimeField, Field
-from django.db.models.sql.datastructures import EmptyResultSet, Empty
+from django.db.models.sql.datastructures import Empty, EmptyResultSet
+from django.utils import timezone, tree
from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.functional import cached_property
from django.utils.six.moves import range
-from django.utils import timezone
-from django.utils import tree
-
# Connection types
AND = 'AND'