[Django] #30534: ModelForms: Allow `cleaned_data` to overwrite fields' default values

10 views
Skip to first unread message

Django

unread,
May 31, 2019, 12:06:48 PM5/31/19
to django-...@googlegroups.com
#30534: ModelForms: Allow `cleaned_data` to overwrite fields' default values
------------------------------------------+-------------------------------
Reporter: RobertAKARobin | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: 2.2
Severity: Normal | Keywords: forms, models
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------+-------------------------------
See comments here:
https://github.com/django/django/pull/7068/files#r289432409

Currently, when submitting a form, if 'some_field' isn't in the data
payload (e.g. it wasn't included in the form, perhaps because its value is
derived from another field), and 'some_field' has a default value on the
model, it cannot be overwritten with 'self.cleaned_data'.

This does not really follow the paradigm of modifying data in
'cleaned_data'. It requires the user to copy and overwrite the raw data
submitted with the form.

--
Ticket URL: <https://code.djangoproject.com/ticket/30534>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 3, 2019, 4:25:30 AM6/3/19
to django-...@googlegroups.com
#30534: Allow `cleaned_data` to overwrite fields' default values.
-------------------------------------+-------------------------------------
Reporter: Robin (Robert) | Owner: Robin
Thomas | (Robert) Thomas
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: forms, models | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* status: new => assigned
* version: 2.2 => master
* owner: nobody => Robin (Robert) Thomas
* has_patch: 0 => 1
* type: New feature => Bug
* stage: Unreviewed => Accepted


Comment:

[https://github.com/django/django/pull/11433 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/30534#comment:1>

Django

unread,
Jun 4, 2019, 2:59:22 AM6/4/19
to django-...@googlegroups.com
#30534: Allow `cleaned_data` to overwrite fields' default values.
-------------------------------------+-------------------------------------
Reporter: Robin (Robert) | Owner: Robin
Thomas | (Robert) Thomas
Type: Bug | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: fixed
Keywords: forms, models | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"aa94f7c899b98f547fc1d26797ba892c38eaf415" aa94f7c8]:
{{{
#!CommitTicketReference repository=""
revision="aa94f7c899b98f547fc1d26797ba892c38eaf415"
Fixed #30534 -- Fixed overriding a field's default in
ModelForm.cleaned_data().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30534#comment:2>

Reply all
Reply to author
Forward
0 new messages