Skip to content

Commit 6ffe3f7

Browse files
committed
minor #17432 [Form] Merging two (almost identical) paragraphs (ThomasLandauer)
This PR was merged into the 5.4 branch. Discussion ---------- [Form] 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. Commits ------- 59b3037 Merging two (almost identical) paragraphs
2 parents ef5d786 + 59b3037 commit 6ffe3f7

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)