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

10 visningar
Hoppa till det första olästa meddelandet

Django

oläst,
31 maj 2019 12:06:482019-05-31
till 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

oläst,
3 juni 2019 04:25:302019-06-03
till 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

oläst,
4 juni 2019 02:59:222019-06-04
till 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>

Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden