diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2012-01-13 00:04:29 +0100 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2012-01-13 00:04:29 +0100 |
commit | aaf283a81b39d6fc3d2ff493abaf14c318887a79 (patch) | |
tree | f3e85c74704acb3a9a8863e8ffe4c7fac8ab31a2 | |
parent | 6329a894c0b148f1c8bba2ebf224201419cf44ff (diff) | |
download | factory-boy-aaf283a81b39d6fc3d2ff493abaf14c318887a79.tar factory-boy-aaf283a81b39d6fc3d2ff493abaf14c318887a79.tar.gz |
Remove deprecated examples from the doc -- explicit is better than implicit, etc.
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
-rw-r--r-- | README.rst | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -32,18 +32,19 @@ Source:: Defining factories ------------------ -Factories declare a set of attributes used to instantiate an object. The name of the factory is used to guess the class of the object by default, but it's possible to explicitly specify it:: +Factories declare a set of attributes used to instantiate an object. The class of the object must be defined in the FACTORY_FOR attribute:: import factory from models import User - # This will guess the User class class UserFactory(factory.Factory): + FACTORY_FOR = User + first_name = 'John' last_name = 'Doe' admin = False - # This will use the User class (Admin would have been guessed) + # Another, different, factory for the same object class AdminFactory(factory.Factory): FACTORY_FOR = User |