summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-01-27 21:30:35 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-01-27 21:30:35 +0000
commit2ffaf5603f2e860ec29f3463407c477dc3b1fec4 (patch)
treef830585c3fc639280bf3c0966457ab553222cdb7 /lib/sqlalchemy
parent931decd84576e4ec61af317424ed683c4576f02a (diff)
downloadsqlalchemy-2ffaf5603f2e860ec29f3463407c477dc3b1fec4.tar.gz
- fix for multi-level polymorphic mappers
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/mapper.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index 4cdf62227..e0ee36fac 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -1149,19 +1149,19 @@ class Mapper(object):
this mapper is the same mapper as 'self' unless the select_table argument was specified for this mapper."""
return self.__surrogate_mapper or self
- def _instance(self, context, row, result = None):
+ def _instance(self, context, row, result = None, skip_polymorphic=False):
"""pulls an object instance from the given row and appends it to the given result
list. if the instance already exists in the given identity map, its not added. in
either case, executes all the property loaders on the instance to also process extra
information in the row."""
- if self.polymorphic_on is not None:
+ if not skip_polymorphic and self.polymorphic_on is not None:
discriminator = row[self.polymorphic_on]
if discriminator is not None:
mapper = self.polymorphic_map[discriminator]
if mapper is not self:
row = self.translate_row(mapper, row)
- return mapper._instance(context, row, result=result)
+ return mapper._instance(context, row, result=result, skip_polymorphic=True)
# look in main identity map. if its there, we dont do anything to it,
# including modifying any of its related items lists, as its already