Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form] Make difference between data and empty_data options more visisble#7802

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
xabbuh merged 10 commits into2.7fromHeahDude-form-empty_data-option
May 4, 2017

Conversation

@wouterj
Copy link
Member

Finishes#6265
Fixes#7299,#7596

value will be set. Use the ``data`` or ``placeholder`` options to show this
initial value in the rendered form.
If a form is compound, you can set ``empty_data`` as an array with field names
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

whendata_class is null, otherwise it has to match the class set for this option.

this default value.
The ``data`` option *always* overrides the value taken from the domain data
(object) when rendering. This means the object value is also overriden when
the form edits an already persisted object, causing it to loose it's
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

[...] to lose its persisted [...]

:doc:`Form data transformers </form/data_transformers>` will still be
applied to the ``empty_data`` value. This means that an empty string will
be casted to ``null``. Use a custom data transformer if you explicitly want
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

cast

@xabbuh
Copy link
Member

Thank you@wouterj.

@xabbuhxabbuh merged commit64e3984 into2.7May 4, 2017
xabbuh added a commit that referenced this pull requestMay 4, 2017
…s more visisble (HeahDude, wouterj, javiereguiluz)This PR was merged into the 2.7 branch.Discussion----------[Form] Make difference between data and empty_data options more visisbleFinishes#6265Fixes#7299,#7596Commits-------64e3984 Fixed a minor typodf9b878 Fixed a minor typof375489 Better explain empty_data valuesd552ea3 Readd mixed type for empty_data, it can be string, array or object188f0ab Tried to write the important points more explicitly5f3813d Updated the example add added a caution4fd2d96 Addressed@stof's comment242941a improved accuracy67c93b6 fix typo87b3542 explicit differences between 'data' & 'empty_data' in FormType
@xabbuhxabbuh deleted the HeahDude-form-empty_data-option branchMay 4, 2017 20:41
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh left review comments

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

+1 more reviewer

@HeahDudeHeahDudeHeahDude left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@wouterj@xabbuh@javiereguiluz@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp