File tree 1 file changed +5
-7
lines changed 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,11 @@ The Difference between Data Transformers and Mappers
19
19
It is important to know the difference between
20
20
:doc: `data transformers </form/data_transformers >` and mappers.
21
21
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.
29
27
30
28
Creating a Data Mapper
31
29
----------------------
You can’t perform that action at this time.
0 commit comments