summaryrefslogtreecommitdiff
path: root/docs/reference.rst
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2013-03-04 23:18:02 +0100
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2013-03-04 23:18:02 +0100
commit7d792430e103984a91c102c33da79be2426bc632 (patch)
tree0044c449e933e93d4fecf1e80e6b361c6c3e8150 /docs/reference.rst
parent9422cf12516143650f1014f34f996260c00d4c0a (diff)
downloadfactory-boy-7d792430e103984a91c102c33da79be2426bc632.tar
factory-boy-7d792430e103984a91c102c33da79be2426bc632.tar.gz
Add a 'after post_generation' hook to Factory.
Use it in DjangoModelFactory to save objects again if a post_generation hook ran. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'docs/reference.rst')
-rw-r--r--docs/reference.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/reference.rst b/docs/reference.rst
index e2246aa..d100b40 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -189,6 +189,19 @@ The :class:`Factory` class
.. OHAI_VIM*
+ .. classmethod:: _after_postgeneration(cls, obj, create, results=None)
+
+ :arg object obj: The object just generated
+ :arg bool create: Whether the object was 'built' or 'created'
+ :arg dict results: Map of post-generation declaration name to call
+ result
+
+ The :meth:`_after_postgeneration` is called once post-generation
+ declarations have been handled.
+
+ Its arguments allow to handle specifically some post-generation return
+ values, for instance.
+
.. _strategies: