From aaf283a81b39d6fc3d2ff493abaf14c318887a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Fri, 13 Jan 2012 00:04:29 +0100 Subject: Remove deprecated examples from the doc -- explicit is better than implicit, etc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaƫl Barrois --- README.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'README.rst') diff --git a/README.rst b/README.rst index f20b129..c3e0b0a 100644 --- a/README.rst +++ b/README.rst @@ -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 -- cgit v1.2.3