Fixed inheritance support for many to many batch fetching

This commit is contained in:
Konsta Vesterinen
2013-09-18 15:38:09 +03:00
parent d49e8c8d5c
commit 1aba09dbf7

View File

@@ -285,12 +285,6 @@ class Fetcher(object):
Populate batch fetched entities to parent objects. Populate batch fetched entities to parent objects.
""" """
for entity in self.path.entities: for entity in self.path.entities:
# print (
# "setting committed value for ",
# entity,
# " using local values ",
# self.local_values(entity)
# )
set_committed_value( set_committed_value(
entity, entity,
self.prop.key, self.prop.key,
@@ -350,7 +344,6 @@ class ManyToManyFetcher(Fetcher):
names = [] names = []
for local, remote in self.prop.local_remote_pairs: for local, remote in self.prop.local_remote_pairs:
for fk in remote.foreign_keys: for fk in remote.foreign_keys:
# TODO: make this support inherited tables
if fk.column.table in self.prop.parent.tables: if fk.column.table in self.prop.parent.tables:
names.append(local.name) names.append(local.name)
return names return names
@@ -360,10 +353,8 @@ class ManyToManyFetcher(Fetcher):
names = [] names = []
for local, remote in self.prop.local_remote_pairs: for local, remote in self.prop.local_remote_pairs:
for fk in remote.foreign_keys: for fk in remote.foreign_keys:
# TODO: make this support inherited tables if fk.column.table in self.prop.parent.tables:
if fk.column.table == self.path.parent_model.__table__:
names.append(fk.parent.name) names.append(fk.parent.name)
return names return names
@property @property