diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-01-13 17:04:35 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-01-13 17:04:35 -0500 |
| commit | b63aae2c232f980a47aa2a635c35dfa45390f451 (patch) | |
| tree | 61d23fbb2884155a30e3117198668e7c59117002 /lib/sqlalchemy/orm/mapper.py | |
| parent | 268bb4d5f6a8c8a23d6f53014980bba58698b4b4 (diff) | |
| download | sqlalchemy-b63aae2c232f980a47aa2a635c35dfa45390f451.tar.gz | |
- The "wildcard" loader options, in particular the one set up by
the :func:`.orm.load_only` option to cover all attributes not
explicitly mentioned, now takes into account the superclasses
of a given entity, if that entity is mapped with inheritance mapping,
so that attribute names within the superclasses are also omitted
from the load. Additionally, the polymorphic discriminator column
is unconditionally included in the list, just in the same way that
primary key columns are, so that even with load_only() set up,
polymorphic loading of subtypes continues to function correctly.
fixes #3287
Diffstat (limited to 'lib/sqlalchemy/orm/mapper.py')
| -rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 0469c2139..74d8f3860 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -2388,6 +2388,13 @@ class Mapper(InspectionAttr): return collection @_memoized_configured_property + def _should_undefer_in_wildcard(self): + cols = set(self.primary_key) + if self.polymorphic_on is not None: + cols.add(self.polymorphic_on) + return cols + + @_memoized_configured_property def _primary_key_propkeys(self): return set([prop.key for prop in self._all_pk_props]) |
