Skip to content

[Form] Merging two (almost identical) paragraphs #17432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions form/data_mappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ The Difference between Data Transformers and Mappers
It is important to know the difference between
:doc:`data transformers </form/data_transformers>` and mappers.

* **Data transformers** change the representation of a value (e.g. from
``"2016-08-12"`` to a ``DateTime`` instance);
* **Data mappers** map data (e.g. an object or array) to form fields, and vice versa.

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

Creating a Data Mapper
----------------------
Expand Down