diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2014-05-18 15:15:45 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2014-05-18 15:15:45 +0200 |
commit | f2d04144167120dc8820401940172d10fdda007b (patch) | |
tree | 19c844b9c510abf22f0bc1c71d3033ada9f319d0 /docs | |
parent | 3a5709527d362a960a1a35769375412e4536839e (diff) | |
download | factory-boy-f2d04144167120dc8820401940172d10fdda007b.tar factory-boy-f2d04144167120dc8820401940172d10fdda007b.tar.gz |
Rename hidden/arg_parameters to exclude/inline_args.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/introduction.rst | 4 | ||||
-rw-r--r-- | docs/reference.rst | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/docs/introduction.rst b/docs/introduction.rst index 5e3b4d8..d00154d 100644 --- a/docs/introduction.rst +++ b/docs/introduction.rst @@ -218,14 +218,14 @@ Non-kwarg arguments Some classes take a few, non-kwarg arguments first. -This is handled by the :data:`~factory.FactoryOptions.arg_parameters` attribute: +This is handled by the :data:`~factory.FactoryOptions.inline_args` attribute: .. code-block:: python class MyFactory(factory.Factory): class Meta: model = MyClass - arg_parameters = ('x', 'y') + inline_args = ('x', 'y') x = 1 y = 2 diff --git a/docs/reference.rst b/docs/reference.rst index d616d1c..25fef22 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -47,10 +47,10 @@ The :class:`Factory` class .. versionadded:: 2.4.0 - .. attribute:: arg_parameters + .. attribute:: inline_args Some factories require non-keyword arguments to their :meth:`~object.__init__`. - They should be listed, in order, in the :attr:`arg_parameters` + They should be listed, in order, in the :attr:`inline_args` attribute: .. code-block:: python @@ -58,7 +58,7 @@ The :class:`Factory` class class UserFactory(factory.Factory): class Meta: model = User - arg_parameters = ('login', 'email') + inline_args = ('login', 'email') login = 'john' email = factory.LazyAttribute(lambda o: '%s@example.com' % o.login) @@ -72,14 +72,14 @@ The :class:`Factory` class .. versionadded:: 2.4.0 - .. attribute:: hidden_args + .. attribute:: exclude While writing a :class:`Factory` for some object, it may be useful to have general fields helping defining others, but that should not be passed to the model class; for instance, a field named 'now' that would hold a reference time used by other objects. - Factory fields whose name are listed in :attr:`hidden_args` will + Factory fields whose name are listed in :attr:`exclude` will be removed from the set of args/kwargs passed to the underlying class; they can be any valid factory_boy declaration: @@ -88,7 +88,7 @@ The :class:`Factory` class class OrderFactory(factory.Factory): class Meta: model = Order - hidden_args = ('now',) + exclude = ('now',) now = factory.LazyAttribute(lambda o: datetime.datetime.utcnow()) started_at = factory.LazyAttribute(lambda o: o.now - datetime.timedelta(hours=1)) @@ -125,12 +125,12 @@ The :class:`Factory` class .. attribute:: FACTORY_ARG_PARAMETERS .. deprecated:: 2.4.0 - See :attr:`FactoryOptions.arg_parameters`. + See :attr:`FactoryOptions.inline_args`. .. attribute:: FACTORY_HIDDEN_ARGS .. deprecated:: 2.4.0 - See :attr:`FactoryOptions.hidden_args`. + See :attr:`FactoryOptions.exclude`. **Class-level attributes:** @@ -231,7 +231,7 @@ The :class:`Factory` class The :meth:`_adjust_kwargs` extension point allows for late fields tuning. It is called once keyword arguments have been resolved and post-generation - items removed, but before the :attr:`~FactoryOptions.arg_parameters` extraction + items removed, but before the :attr:`~FactoryOptions.inline_args` extraction phase. .. code-block:: python |