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

Bumped minimum isort version to 5.1.0.

Fixed inner imports per isort 5.
isort 5.0.0 to 5.1.0 was unstable.
This commit is contained in:
David Smith
2020-07-24 07:25:47 +01:00
committed by Mariusz Felisiak
parent 1173db4a16
commit e74b3d724e
49 changed files with 115 additions and 59 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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))
)

View File

@@ -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