summaryrefslogtreecommitdiff
path: root/docs/examples.rst
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2016-02-14 23:12:02 +0000
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2016-02-14 23:12:02 +0000
commit4fc9caa17bd464cf749bfba6af0a4c698da30ccb (patch)
tree6ec891d81d4f1a363ad9ca47cc62ae19946d6985 /docs/examples.rst
parent86dc8baea87c69e1d39a3d87e1271fbd0e85ca63 (diff)
parentf2c075c40fd331b7d26a9db72aad249b2165eac4 (diff)
downloadfactory-boy-4fc9caa17bd464cf749bfba6af0a4c698da30ccb.tar
factory-boy-4fc9caa17bd464cf749bfba6af0a4c698da30ccb.tar.gz
Merge pull request #267 from bors-ltd/master
factory: LazyFunction to just call a function in the simplest case
Diffstat (limited to 'docs/examples.rst')
-rw-r--r--docs/examples.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/examples.rst b/docs/examples.rst
index e7f6057..6f26b7e 100644
--- a/docs/examples.rst
+++ b/docs/examples.rst
@@ -49,6 +49,7 @@ And now, we'll define the related factories:
.. code-block:: python
+ import datetime
import factory
import random
@@ -61,6 +62,7 @@ And now, we'll define the related factories:
username = factory.Sequence(lambda n: 'john%s' % n)
email = factory.LazyAttribute(lambda o: '%s@example.org' % o.username)
+ date_joined = factory.LazyFunction(datetime.datetime.now)
class ProfileFactory(factory.Factory):