From 0459f63a6afba932f46db12b8c9e95b0b9f4dffa Mon Sep 17 00:00:00 2001 From: Konsta Vesterinen Date: Thu, 8 Aug 2013 15:03:28 +0300 Subject: [PATCH] Fixed parent dict initialization in batch_fetch --- sqlalchemy_utils/functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlalchemy_utils/functions.py b/sqlalchemy_utils/functions.py index 2b961e6..e6a5127 100644 --- a/sqlalchemy_utils/functions.py +++ b/sqlalchemy_utils/functions.py @@ -416,9 +416,9 @@ def batch_fetch(entities, *attr_paths): if entities: first = entities[0] parent_ids = [entity.id for entity in entities] - parent_dict = dict((entity.id, []) for entity in entities) for attr_path in attr_paths: + parent_dict = dict((entity.id, []) for entity in entities) if isinstance(attr_path, six.string_types): attrs = attr_path.split('.')