diff options
| author | Tim Graham <timograham@gmail.com> | 2016-04-03 20:37:32 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-04-04 17:14:26 -0400 |
| commit | 2cd2d188516475ddf256e6267cd82c495fb5c430 (patch) | |
| tree | 1a7c3c167c1576923c7c4f5544495face5bd7327 /django/db/models/sql | |
| parent | d356bb653f4d90ae9809e5a051791ded39010c38 (diff) | |
Fixed W503 flake8 warnings.
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/query.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 1223e9a109..4a5eb1701a 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -735,9 +735,7 @@ class Query(object): # Only the first alias (skipped above) should have None join_type assert self.alias_map[alias].join_type is not None parent_alias = self.alias_map[alias].parent_alias - parent_louter = ( - parent_alias - and self.alias_map[parent_alias].join_type == LOUTER) + parent_louter = parent_alias and self.alias_map[parent_alias].join_type == LOUTER already_louter = self.alias_map[alias].join_type == LOUTER if ((self.alias_map[alias].nullable or parent_louter) and not already_louter): @@ -746,8 +744,8 @@ class Query(object): # refer to this one. aliases.extend( join for join in self.alias_map.keys() - if (self.alias_map[join].parent_alias == alias - and join not in aliases)) + if self.alias_map[join].parent_alias == alias and join not in aliases + ) def demote_joins(self, aliases): """ @@ -1641,8 +1639,7 @@ class Query(object): # from the model on which the lookup failed. raise else: - names = sorted(list(get_field_names_from_opts(opts)) + list(self.extra) - + list(self.annotation_select)) + names = sorted(list(get_field_names_from_opts(opts)) + list(self.extra) + list(self.annotation_select)) raise FieldError("Cannot resolve keyword %r into field. " "Choices are: %s" % (name, ", ".join(names))) @@ -1963,8 +1960,7 @@ class Query(object): # used. The proper fix would be to defer all decisions where # 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): + if connections[DEFAULT_DB_ALIAS].features.interprets_empty_strings_as_nulls and field.empty_strings_allowed: return True else: return field.null |
