diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-13 18:31:19 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-13 18:31:19 +0000 |
| commit | db4af57e206b059a8d3e78a971834982fa8aa062 (patch) | |
| tree | 3fef3ad2a37b46592aa22129ebdd5c5348b149e8 /lib/sqlalchemy/orm | |
| parent | 3c1a8adc782b9440b3e7e350712cdfa231c56f7f (diff) | |
| download | sqlalchemy-db4af57e206b059a8d3e78a971834982fa8aa062.tar.gz | |
- replace the tip of the path info with the subclass mapper being used.
that way accurate "load_path" info is available for options
invoked during deferred loads.
we lose AliasedClass path elements this way, but currently,
those are not needed at this stage.
Diffstat (limited to 'lib/sqlalchemy/orm')
| -rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 9e0377105..5faa719d3 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -1805,7 +1805,18 @@ class Mapper(object): raise AssertionError("No such polymorphic_identity %r is defined" % discriminator) if mapper is self: return None - return mapper._instance_processor(context, path, adapter, polymorphic_from=self) + + # replace the tip of the path info with the subclass mapper being used. + # that way accurate "load_path" info is available for options + # invoked during deferred loads. + # we lose AliasedClass path elements this way, but currently, + # those are not needed at this stage. + + # this asserts to true + #assert mapper.isa(_class_to_mapper(path[-1])) + + return mapper._instance_processor(context, path[0:-1] + (mapper,), + adapter, polymorphic_from=self) return configure_subclass_mapper log.class_logger(Mapper) |
