summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
Diffstat (limited to 'django/db')
-rw-r--r--django/db/backends/__init__.py2
-rw-r--r--django/db/backends/mysql/compiler.py2
-rw-r--r--django/db/models/deletion.py4
-rw-r--r--django/db/models/fields/__init__.py2
-rw-r--r--django/db/models/query.py4
-rw-r--r--django/db/models/sql/query.py8
-rw-r--r--django/db/models/sql/subqueries.py2
-rw-r--r--django/db/models/sql/where.py4
8 files changed, 14 insertions, 14 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index a23751caf5..a2a1757ad3 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -153,7 +153,7 @@ class BaseDatabaseWrapper(object):
"""
self.validate_thread_sharing()
if (self.use_debug_cursor or
- (self.use_debug_cursor is None and settings.DEBUG)):
+ (self.use_debug_cursor is None and settings.DEBUG)):
cursor = self.make_debug_cursor(self._cursor())
else:
cursor = utils.CursorWrapper(self._cursor(), self)
diff --git a/django/db/backends/mysql/compiler.py b/django/db/backends/mysql/compiler.py
index 609573442c..85c045fff2 100644
--- a/django/db/backends/mysql/compiler.py
+++ b/django/db/backends/mysql/compiler.py
@@ -8,7 +8,7 @@ class SQLCompiler(compiler.SQLCompiler):
index_extra_select = len(self.query.extra_select)
for value, field in zip_longest(row[index_extra_select:], fields):
if (field and field.get_internal_type() in ("BooleanField", "NullBooleanField") and
- value in (0, 1)):
+ value in (0, 1)):
value = bool(value)
values.append(value)
return row[:index_extra_select] + tuple(values)
diff --git a/django/db/models/deletion.py b/django/db/models/deletion.py
index 90e515cce5..8b48815a0d 100644
--- a/django/db/models/deletion.py
+++ b/django/db/models/deletion.py
@@ -135,7 +135,7 @@ class Collector(object):
# Foreign keys pointing to this model, both from m2m and other
# models.
for related in opts.get_all_related_objects(
- include_hidden=True, include_proxy_eq=True):
+ include_hidden=True, include_proxy_eq=True):
if related.field.rel.on_delete is not DO_NOTHING:
return False
# GFK deletes
@@ -145,7 +145,7 @@ class Collector(object):
return True
def collect(self, objs, source=None, nullable=False, collect_related=True,
- source_attr=None, reverse_dependency=False):
+ source_attr=None, reverse_dependency=False):
"""
Adds 'objs' to the collection of objects to be deleted as well as all
parent instances. 'objs' must be a homogenous iterable collection of
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index dec2e2dd9e..1fa230e1c2 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -1281,7 +1281,7 @@ class IntegerField(Field):
def get_prep_lookup(self, lookup_type, value):
if ((lookup_type == 'gte' or lookup_type == 'lt')
- and isinstance(value, float)):
+ and isinstance(value, float)):
value = math.ceil(value)
return super(IntegerField, self).get_prep_lookup(lookup_type, value)
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 1737626d16..58180e1cf9 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -392,7 +392,7 @@ class QuerySet(object):
fields = self.model._meta.local_fields
with transaction.commit_on_success_unless_managed(using=self.db):
if (connection.features.can_combine_inserts_with_and_without_auto_increment_pk
- and self.model._meta.has_auto_field):
+ and self.model._meta.has_auto_field):
self._batched_insert(objs, fields, batch_size)
else:
objs_with_pk, objs_without_pk = partition(lambda o: o.pk is None, objs)
@@ -1494,7 +1494,7 @@ class RawQuerySet(object):
annotated model instances.
"""
def __init__(self, raw_query, model=None, query=None, params=None,
- translations=None, using=None, hints=None):
+ translations=None, using=None, hints=None):
self.raw_query = raw_query
self.model = model
self._db = using
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index e0593ef0a7..5f24e488cb 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -994,9 +994,9 @@ class Query(object):
raise FieldError("Cannot compute %s('%s'): '%s' is an aggregate" % (
aggregate.name, field_name, field_name))
elif ((len(field_list) > 1) or
- (field_list[0] not in [i.name for i in opts.fields]) or
- self.group_by is None or
- not is_summary):
+ (field_list[0] not in [i.name for i in opts.fields]) or
+ self.group_by is None or
+ not is_summary):
# If:
# - the field descriptor has more than one part (foo__bar), or
# - the field descriptor is referencing an m2m/m2o field, or
@@ -1906,7 +1906,7 @@ class Query(object):
# is_nullable() is needed to the compiler stage, but that is not easy
# to do currently.
if ((connections[DEFAULT_DB_ALIAS].features.interprets_empty_strings_as_nulls)
- and field.empty_strings_allowed):
+ and field.empty_strings_allowed):
return True
else:
return field.null
diff --git a/django/db/models/sql/subqueries.py b/django/db/models/sql/subqueries.py
index 79db1ad99a..e9e292e787 100644
--- a/django/db/models/sql/subqueries.py
+++ b/django/db/models/sql/subqueries.py
@@ -61,7 +61,7 @@ class DeleteQuery(Query):
innerq_used_tables = [t for t in innerq.tables
if innerq.alias_refcount[t]]
if ((not innerq_used_tables or innerq_used_tables == self.tables)
- and not len(innerq.having)):
+ and not len(innerq.having)):
# There is only the base table in use in the query, and there is
# no aggregate filtering going on.
self.where = innerq.where
diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py
index 7b71580370..44a4ce9d1d 100644
--- a/django/db/models/sql/where.py
+++ b/django/db/models/sql/where.py
@@ -69,7 +69,7 @@ class WhereNode(tree.Node):
# and empty values need special handling. Other types could be used
# here in the future (using Python types is suggested for consistency).
if (isinstance(value, datetime.datetime)
- or (isinstance(obj.field, DateTimeField) and lookup_type != 'isnull')):
+ or (isinstance(obj.field, DateTimeField) and lookup_type != 'isnull')):
value_annotation = datetime.datetime
elif hasattr(value, 'value_annotation'):
value_annotation = value.value_annotation
@@ -207,7 +207,7 @@ class WhereNode(tree.Node):
params = field_params + params
if (len(params) == 1 and params[0] == '' and lookup_type == 'exact'
- and connection.features.interprets_empty_strings_as_nulls):
+ and connection.features.interprets_empty_strings_as_nulls):
lookup_type = 'isnull'
value_annotation = True