summaryrefslogtreecommitdiff
path: root/factory/declarations.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2012-02-24 00:17:04 +0100
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2012-02-24 00:17:04 +0100
commit826312ad0629ab49cab436d7cb1d27a898e7d864 (patch)
treea601961ade8173ce06c348acbd5ca949041b1896 /factory/declarations.py
parent2a1138550b3220b6f8cd23bae5fed03f0fb448cf (diff)
downloadfactory-boy-826312ad0629ab49cab436d7cb1d27a898e7d864.tar
factory-boy-826312ad0629ab49cab436d7cb1d27a898e7d864.tar.gz
Improve documentation.
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'factory/declarations.py')
-rw-r--r--factory/declarations.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/factory/declarations.py b/factory/declarations.py
index 60425c3..08598e5 100644
--- a/factory/declarations.py
+++ b/factory/declarations.py
@@ -155,8 +155,9 @@ class ContainerAttribute(OrderedDeclaration):
Args:
obj (LazyStub): a lazy stub of the object being constructed, if
needed.
- containers (LazyStub): a lazy stub of a factory being evaluated, with
- a SubFactory building 'obj'.
+ containers (list of LazyStub): a list of lazy stubs of factories
+ being evaluated in a chain, each item being a future field of
+ next one.
"""
if self.strict and not containers:
raise TypeError(
@@ -187,6 +188,14 @@ class SubFactory(OrderedDeclaration):
- attributes defined in the wrapped factory class
- values defined when defining the SubFactory
- additional values defined in attributes
+
+ Args:
+ create (bool): whether the subfactory should call 'build' or
+ 'create'
+ extra (containers.DeclarationDict): extra values that should
+ override the wrapped factory's defaults
+ containers (list of LazyStub): List of LazyStub for the chain of
+ factories being evaluated, the calling stub being first.
"""
defaults = dict(self.defaults)