summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
Diffstat (limited to 'django/db')
-rw-r--r--django/db/backends/base/base.py2
-rw-r--r--django/db/models/fields/related_lookups.py6
-rw-r--r--django/db/models/functions/mixins.py4
-rw-r--r--django/db/models/lookups.py4
4 files changed, 11 insertions, 5 deletions
diff --git a/django/db/backends/base/base.py b/django/db/backends/base/base.py
index a1b5b1db64..fcaa4b46e9 100644
--- a/django/db/backends/base/base.py
+++ b/django/db/backends/base/base.py
@@ -1,3 +1,4 @@
+import _thread
import copy
import threading
import time
@@ -5,7 +6,6 @@ import warnings
from collections import deque
from contextlib import contextmanager
-import _thread
import pytz
from django.conf import settings
diff --git a/django/db/models/fields/related_lookups.py b/django/db/models/fields/related_lookups.py
index c20e220141..d745ecd5f9 100644
--- a/django/db/models/fields/related_lookups.py
+++ b/django/db/models/fields/related_lookups.py
@@ -64,7 +64,9 @@ class RelatedIn(In):
# For multicolumn lookups we need to build a multicolumn where clause.
# This clause is either a SubqueryConstraint (for values that need to be compiled to
# SQL) or an OR-combined list of (col1 = val1 AND col2 = val2 AND ...) clauses.
- from django.db.models.sql.where import WhereNode, SubqueryConstraint, AND, OR
+ from django.db.models.sql.where import (
+ AND, OR, SubqueryConstraint, WhereNode,
+ )
root_constraint = WhereNode(connector=OR)
if self.rhs_is_direct_value():
@@ -120,7 +122,7 @@ class RelatedLookupMixin:
if isinstance(self.lhs, MultiColSource):
assert self.rhs_is_direct_value()
self.rhs = get_normalized_value(self.rhs, self.lhs)
- from django.db.models.sql.where import WhereNode, AND
+ from django.db.models.sql.where import AND, WhereNode
root_constraint = WhereNode()
for target, source, val in zip(self.lhs.targets, self.lhs.sources, self.rhs):
lookup_class = target.get_lookup(self.lookup_name)
diff --git a/django/db/models/functions/mixins.py b/django/db/models/functions/mixins.py
index 636340f015..00cfd1bc01 100644
--- a/django/db/models/functions/mixins.py
+++ b/django/db/models/functions/mixins.py
@@ -32,7 +32,9 @@ class FixDurationInputMixin:
if self.output_field.get_internal_type() == 'DurationField':
expression = self.get_source_expressions()[0]
options = self._get_repr_options()
- from django.db.backends.oracle.functions import IntervalToSeconds, SecondsToInterval
+ from django.db.backends.oracle.functions import (
+ IntervalToSeconds, SecondsToInterval,
+ )
return compiler.compile(
SecondsToInterval(self.__class__(IntervalToSeconds(expression), **options))
)
diff --git a/django/db/models/lookups.py b/django/db/models/lookups.py
index f358e50d5b..a4fbb04648 100644
--- a/django/db/models/lookups.py
+++ b/django/db/models/lookups.py
@@ -29,7 +29,9 @@ class Lookup:
if bilateral_transforms:
# Warn the user as soon as possible if they are trying to apply
# a bilateral transformation on a nested QuerySet: that won't work.
- from django.db.models.sql.query import Query # avoid circular import
+ from django.db.models.sql.query import ( # avoid circular import
+ Query,
+ )
if isinstance(rhs, Query):
raise NotImplementedError("Bilateral transformations on nested querysets are not implemented.")
self.bilateral_transforms = bilateral_transforms