summaryrefslogtreecommitdiff
path: root/docs/examples.rst
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2014-05-18 14:46:03 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2014-05-18 14:46:03 +0200
commitb245a83019a8735d0c80c07275cd426bc60dd9f8 (patch)
tree00c936e2479056d829f3d6377a68f3e5cbb6af50 /docs/examples.rst
parentfd3d2583580fc18ff1531b5be02238c8c2addccc (diff)
downloadfactory-boy-b245a83019a8735d0c80c07275cd426bc60dd9f8.tar
factory-boy-b245a83019a8735d0c80c07275cd426bc60dd9f8.tar.gz
Update docs for class Meta.
Diffstat (limited to 'docs/examples.rst')
-rw-r--r--docs/examples.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/examples.rst b/docs/examples.rst
index aab990a..52a5ef6 100644
--- a/docs/examples.rst
+++ b/docs/examples.rst
@@ -56,14 +56,16 @@ And now, we'll define the related factories:
class AccountFactory(factory.Factory):
- FACTORY_FOR = objects.Account
+ class Meta:
+ target = objects.Account
username = factory.Sequence(lambda n: 'john%s' % n)
email = factory.LazyAttribute(lambda o: '%s@example.org' % o.username)
class ProfileFactory(factory.Factory):
- FACTORY_FOR = objects.Profile
+ class Meta:
+ target = objects.Profile
account = factory.SubFactory(AccountFactory)
gender = factory.Iterator([objects.Profile.GENDER_MALE, objects.Profile.GENDER_FEMALE])