Skip to content

Commit 59b3037

Browse files
Merging two (almost identical) paragraphs
The only new aspect is that Transformer is only for only one field, whereas Mapper is for one or more.
1 parent 4d40cfd commit 59b3037

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

form/data_mappers.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ The Difference between Data Transformers and Mappers
1919
It is important to know the difference between
2020
:doc:`data transformers </form/data_transformers>` and mappers.
2121

22-
* **Data transformers** change the representation of a value (e.g. from
23-
``"2016-08-12"`` to a ``DateTime`` instance);
24-
* **Data mappers** map data (e.g. an object or array) to form fields, and vice versa.
25-
26-
Changing a ``YYYY-mm-dd`` string value to a ``DateTime`` instance is done by a
27-
data transformer. Populating inner fields (e.g year, hour, etc) of a compound date type using
28-
a ``DateTime`` instance is done by the data mapper.
22+
* **Data transformers** change the representation of a single value, e.g. from
23+
``"2016-08-12"`` to a ``DateTime`` instance;
24+
* **Data mappers** map data (e.g. an object or array) to one or many form fields, and vice versa,
25+
e.g. using a single ``DateTime`` instance to populate the inner fields (e.g year, hour, etc.)
26+
of a compound date type.
2927

3028
Creating a Data Mapper
3129
----------------------

0 commit comments

Comments
 (0)