From 1aba09dbf7d7d428c76b1d03704a976c90f0d590 Mon Sep 17 00:00:00 2001 From: Konsta Vesterinen Date: Wed, 18 Sep 2013 15:38:09 +0300 Subject: [PATCH] Fixed inheritance support for many to many batch fetching --- sqlalchemy_utils/functions/batch_fetch.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/sqlalchemy_utils/functions/batch_fetch.py b/sqlalchemy_utils/functions/batch_fetch.py index 0ae5696..ad4cfa2 100644 --- a/sqlalchemy_utils/functions/batch_fetch.py +++ b/sqlalchemy_utils/functions/batch_fetch.py @@ -285,12 +285,6 @@ class Fetcher(object): Populate batch fetched entities to parent objects. """ for entity in self.path.entities: - # print ( - # "setting committed value for ", - # entity, - # " using local values ", - # self.local_values(entity) - # ) set_committed_value( entity, self.prop.key, @@ -350,7 +344,6 @@ class ManyToManyFetcher(Fetcher): names = [] for local, remote in self.prop.local_remote_pairs: for fk in remote.foreign_keys: - # TODO: make this support inherited tables if fk.column.table in self.prop.parent.tables: names.append(local.name) return names @@ -360,10 +353,8 @@ class ManyToManyFetcher(Fetcher): names = [] for local, remote in self.prop.local_remote_pairs: for fk in remote.foreign_keys: - # TODO: make this support inherited tables - if fk.column.table == self.path.parent_model.__table__: + if fk.column.table in self.prop.parent.tables: names.append(fk.parent.name) - return names @property