Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion django/db/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def __new__(cls, name, bases, attrs):
if base not in parents or not hasattr(base, '_meta'):
# Things without _meta aren't functional models, so they're
# uninteresting parents.
inherited_attributes |= set(base.__dict__.keys())
inherited_attributes.update(base.__dict__)
continue

parent_fields = base._meta.local_fields + base._meta.local_many_to_many
Expand Down
2 changes: 1 addition & 1 deletion django/db/models/sql/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ def prepare_lookup_value(self, value, lookups, can_reuse, allow_joins=True):
)
# The used_joins for a tuple of expressions is the union of
# the used_joins for the individual expressions.
used_joins |= set(k for k, v in self.alias_refcount.items() if v > pre_joins.get(k, 0))
used_joins.update(k for k, v in self.alias_refcount.items() if v > pre_joins.get(k, 0))
# For Oracle '' is equivalent to null. The check needs to be done
# at this stage because join promotion can't be done at compiler
# stage. Using DEFAULT_DB_ALIAS isn't nice, but it is the best we
Expand Down
7 changes: 2 additions & 5 deletions django/test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from contextlib import contextmanager
from functools import wraps
from io import StringIO
from itertools import chain
from types import SimpleNamespace
from unittest import TestCase, skipIf, skipUnless
from xml.dom.minidom import Node, parseString
Expand Down Expand Up @@ -85,11 +86,7 @@ def keys(self):
"""
Flattened keys of subcontexts.
"""
keys = set()
for subcontext in self:
for dict in subcontext:
keys |= set(dict.keys())
return keys
return set(chain.from_iterable(d for subcontext in self for d in subcontext))


def instrumented_test_render(self, context):
Expand Down