[Django] #27223: model RangeField with default value are skiped in ModelForm full_clean validation in construct_instance function

4 views
Skip to first unread message

Django

unread,
Sep 14, 2016, 7:21:07 AM9/14/16
to django-...@googlegroups.com
#27223: model RangeField with default value are skiped in ModelForm full_clean
validation in construct_instance function
---------------------------------+--------------------
Reporter: taxido | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.10
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------
https://github.com/django/django/commit/4bc6b939944183533ae74791d21282e613f63a96
That change in construct_instance function makes a bug with custom
full_clean validation for *RangeField like fields

RangeField values are send in POST method by two key=value pair:
my_range_0=1&my_range_1=9
that there is not my_range field in POST so field value is skipped and not
copied to instance.

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

Django

unread,
Sep 14, 2016, 10:30:39 AM9/14/16
to django-...@googlegroups.com
#27223: model RangeField with default value are skiped in ModelForm full_clean
validation in construct_instance function
---------------------------------+--------------------------------------
Reporter: taxido | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: 1.10
Severity: Release blocker | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by timgraham):

* status: new => closed
* needs_better_patch: => 0
* resolution: => duplicate
* needs_tests: => 0
* needs_docs: => 0


Comment:

`RangeWidget` is a subclass of `MultiWidget` so the patch for #27186
should fix this. Could you confirm?

In investigating the other widgets in `contrib.postgres`, I noticed that
`SplitArrayWidget` needs to be fixed. I'll push an update to my PR
shortly.

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

Django

unread,
Sep 20, 2016, 9:30:41 AM9/20/16
to django-...@googlegroups.com
#27223: model RangeField with default value are skiped in ModelForm full_clean
validation in construct_instance function
---------------------------------+--------------------------------------
Reporter: taxido | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: 1.10
Severity: Release blocker | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Description changed by taxido:

Old description:

> https://github.com/django/django/commit/4bc6b939944183533ae74791d21282e613f63a96
> That change in construct_instance function makes a bug with custom
> full_clean validation for *RangeField like fields
>
> RangeField values are send in POST method by two key=value pair:
> my_range_0=1&my_range_1=9
> that there is not my_range field in POST so field value is skipped and
> not copied to instance.

New description:

Yes, this patch fix this.
Thank you, and I waiting for 1.10.2 shortly

--

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

Django

unread,
Sep 20, 2016, 9:31:11 AM9/20/16
to django-...@googlegroups.com
#27223: model RangeField with default value are skiped in ModelForm full_clean
validation in construct_instance function
---------------------------------+--------------------------------------
Reporter: taxido | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: 1.10
Severity: Release blocker | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

Comment (by taxido):

Yes, this patch fix this.
Thank you, and I waiting for 1.10.2 shortly

--
Ticket URL: <https://code.djangoproject.com/ticket/27223#comment:3>

Django

unread,
Sep 20, 2016, 9:31:30 AM9/20/16
to django-...@googlegroups.com
#27223: model RangeField with default value are skiped in ModelForm full_clean
validation in construct_instance function
---------------------------------+--------------------------------------
Reporter: taxido | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: 1.10
Severity: Release blocker | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Description changed by taxido:

Old description:

> Yes, this patch fix this.


> Thank you, and I waiting for 1.10.2 shortly

New description:

>
https://github.com/django/django/commit/4bc6b939944183533ae74791d21282e613f63a96
> That change in construct_instance function makes a bug with custom
> full_clean validation for *RangeField like fields
>
> RangeField values are send in POST method by two key=value pair:
> my_range_0=1&my_range_1=9
> that there is not my_range field in POST so field value is skipped and
> not copied to instance.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/27223#comment:4>

Reply all
Reply to author
Forward
0 new messages