diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2013-09-24 20:52:26 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2013-09-24 20:52:26 +0200 |
commit | 8e37debdc17c5649b8d6b2cf035fb58c4ad3c077 (patch) | |
tree | 439b52a21ad1f11e8b4abc37d20ecb190b2ef3e2 /factory/containers.py | |
parent | 7fe9dcaa8494e73d57613d1288b4f86c4cba5bf0 (diff) | |
download | factory-boy-8e37debdc17c5649b8d6b2cf035fb58c4ad3c077.tar factory-boy-8e37debdc17c5649b8d6b2cf035fb58c4ad3c077.tar.gz |
Lint
Diffstat (limited to 'factory/containers.py')
-rw-r--r-- | factory/containers.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/factory/containers.py b/factory/containers.py index 4975036..7a4c5db 100644 --- a/factory/containers.py +++ b/factory/containers.py @@ -240,12 +240,13 @@ class AttributeBuilder(object): self._attrs = factory.declarations(extra) self._log_ctx = log_ctx + initial_declarations = factory.declarations({}) attrs_with_subfields = [ - k for k, v in self._attrs.items() + k for k, v in initial_declarations.items() if self.has_subfields(v)] self._subfields = utils.multi_extract_dict( - attrs_with_subfields, self._attrs) + attrs_with_subfields, self._attrs) def has_subfields(self, value): return isinstance(value, declarations.ParameteredAttribute) @@ -270,9 +271,9 @@ class AttributeBuilder(object): for k, v in self._attrs.items(): if isinstance(v, declarations.OrderedDeclaration): v = OrderedDeclarationWrapper(v, - sequence=sequence, - create=create, - extra=self._subfields.get(k, {}), + sequence=sequence, + create=create, + extra=self._subfields.get(k, {}), ) wrapped_attrs[k] = v |