summaryrefslogtreecommitdiff
path: root/docs/reference.rst
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2013-03-03 21:00:11 +0100
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2013-03-03 21:38:46 +0100
commit94a7e2659e3e8b6a9183b59aed06223cc1706c87 (patch)
tree01d45a25e707c1513c188d27f01b9bdf42e9df6d /docs/reference.rst
parente8dc25b5db5b470a64cc6a89259d476269fcebb5 (diff)
downloadfactory-boy-94a7e2659e3e8b6a9183b59aed06223cc1706c87.tar
factory-boy-94a7e2659e3e8b6a9183b59aed06223cc1706c87.tar.gz
Update ChangeLog for 1.3.0
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'docs/reference.rst')
-rw-r--r--docs/reference.rst27
1 files changed, 18 insertions, 9 deletions
diff --git a/docs/reference.rst b/docs/reference.rst
index edbd527..efb70e8 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -720,15 +720,24 @@ Iterator
.. class:: Iterator(iterable, cycle=True, getter=None)
-The :class:`Iterator` declaration takes succesive values from the given
-iterable. When it is exhausted, it starts again from zero (unless ``cycle=False``).
+ The :class:`Iterator` declaration takes succesive values from the given
+ iterable. When it is exhausted, it starts again from zero (unless ``cycle=False``).
-The ``cycle`` argument is only useful for advanced cases, where the provided
-iterable has no end (as wishing to cycle it means storing values in memory...).
+ .. attribute:: cycle
-.. versionadded:: 1.3.0
- The ``cycle`` argument is available as of v1.3.0; previous versions
- had a behaviour equivalent to ``cycle=False``.
+ The ``cycle`` argument is only useful for advanced cases, where the provided
+ iterable has no end (as wishing to cycle it means storing values in memory...).
+
+ .. versionadded:: 1.3.0
+ The ``cycle`` argument is available as of v1.3.0; previous versions
+ had a behaviour equivalent to ``cycle=False``.
+
+ .. attribute:: getter
+
+ A custom function called on each value returned by the iterable.
+ See the :ref:`iterator-getter` section for details.
+
+ .. versionadded:: 1.3.0
Each call to the factory will receive the next value from the iterable:
@@ -756,6 +765,8 @@ When a value is passed in for the argument, the iterator will *not* be advanced:
>>> UserFactory().lang
'fr'
+.. _iterator-getter:
+
Getter
~~~~~~
@@ -764,8 +775,6 @@ This is handled by the :attr:`~Iterator.getter` attribute: this is a function
that accepts as sole parameter a value from the iterable, and returns an
adequate value.
-.. versionadded:: 1.3.0
-
.. code-block:: python
class UserFactory(factory.Factory):