From 3a5709527d362a960a1a35769375412e4536839e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Sun, 18 May 2014 15:10:56 +0200 Subject: Rename 'target' to 'model'. --- README.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'README.rst') diff --git a/README.rst b/README.rst index 787d754..b4ba689 100644 --- a/README.rst +++ b/README.rst @@ -95,7 +95,7 @@ Defining factories """""""""""""""""" Factories declare a set of attributes used to instantiate an object. -The class of the object must be defined in the ``target`` field of a ``class Meta:`` attribute: +The class of the object must be defined in the ``model`` field of a ``class Meta:`` attribute: .. code-block:: python @@ -104,7 +104,7 @@ The class of the object must be defined in the ``target`` field of a ``class Met class UserFactory(factory.Factory): class Meta: - target = models.User + model = models.User first_name = 'John' last_name = 'Doe' @@ -113,7 +113,7 @@ The class of the object must be defined in the ``target`` field of a ``class Met # Another, different, factory for the same object class AdminFactory(factory.Factory): class Meta: - target = models.User + model = models.User first_name = 'Admin' last_name = 'User' @@ -168,7 +168,7 @@ These "lazy" attributes can be added as follows: class UserFactory(factory.Factory): class Meta: - target = models.User + model = models.User first_name = 'Joe' last_name = 'Blow' @@ -189,7 +189,7 @@ Unique values in a specific format (for example, e-mail addresses) can be genera class UserFactory(factory.Factory): class Meta: - target = models.User + model = models.User email = factory.Sequence(lambda n: 'person{0}@example.com'.format(n)) @@ -209,7 +209,7 @@ This is handled by the ``SubFactory`` helper: class PostFactory(factory.Factory): class Meta: - target = models.Post + model = models.Post author = factory.SubFactory(UserFactory) -- cgit v1.2.3