summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/changelog.rst9
-rw-r--r--docs/reference.rst23
2 files changed, 31 insertions, 1 deletions
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 8f63567..cd5d281 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -1,6 +1,15 @@
ChangeLog
=========
+.. _v2.6.0:
+
+2.6.0 (XXXX-XX-XX)
+------------------
+
+*New:*
+
+ - Add :attr:`factory.FactoryOptions.rename` to help handle conflicting names (:issue:`206`)
+
.. _v2.5.2:
2.5.2 (2015-04-21)
diff --git a/docs/reference.rst b/docs/reference.rst
index 44f78b6..0705ca2 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -106,6 +106,28 @@ The :class:`Factory` class
.. versionadded:: 2.4.0
+ .. attribute:: rename
+
+ Sometimes, a model expect a field with a name already used by one
+ of :class:`Factory`'s methods.
+
+ In this case, the :attr:`rename` attributes allows to define renaming
+ rules: the keys of the :attr:`rename` dict are those used in the
+ :class:`Factory` declarations, and their values the new name:
+
+ .. code-block:: python
+
+ class ImageFactory(factory.Factory):
+ # The model expects "attributes"
+ form_attributes = ['thumbnail', 'black-and-white']
+
+ class Meta:
+ model = Image
+ rename = {'form_attributes': 'attributes'}
+
+ .. versionadded: 2.6.0
+
+
.. attribute:: strategy
Use this attribute to change the strategy used by a :class:`Factory`.
@@ -229,7 +251,6 @@ The :class:`Factory` class
.. OHAI_VIM**
-
.. classmethod:: _setup_next_sequence(cls)
This method will compute the first value to use for the sequence counter