[Django] #24841: BaseRangeField should use base_field's prepare_value method

15 views
Skip to first unread message

Django

unread,
May 22, 2015, 10:47:24 AM5/22/15
to django-...@googlegroups.com
#24841: BaseRangeField should use base_field's prepare_value method
----------------------------------+-----------------
Reporter: unklphil | Owner:
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 1 | UI/UX: 0
----------------------------------+-----------------
The `BaseRangeField` doesn't do the `base_field`'s `prepare_value` method
on the submitted range values, so the base field preparations are not
applied to the values.

For the basic types, this isn't a problem, but for `DateTimeRangeField` it
is, because the `DateTimeField` (`DateTimeRangeField`'s `base_field`) does
a timezone conversion on the submitted values, but `DateTimeRangeField`
leaves the timezone as is.

What then happens is that datetimes displayed by the field are in UTC, but
they are submitted as the local timezone.

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

Django

unread,
May 22, 2015, 10:47:43 AM5/22/15
to django-...@googlegroups.com
#24841: BaseRangeField should use base_field's prepare_value method
----------------------------------+--------------------------------------
Reporter: unklphil | Owner: unklphil
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* owner: => unklphil
* needs_docs: => 0
* status: new => assigned
* needs_tests: => 0
* needs_better_patch: => 0


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

Django

unread,
May 22, 2015, 10:48:59 AM5/22/15
to django-...@googlegroups.com
#24841: BaseRangeField should use base_field's prepare_value method
----------------------------------+--------------------------------------
Reporter: unklphil | Owner: unklphil
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
----------------------------------+--------------------------------------

Comment (by unklphil):

Pull request: https://github.com/django/django/pull/4695

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

Django

unread,
May 22, 2015, 11:38:11 AM5/22/15
to django-...@googlegroups.com
#24841: BaseRangeField should use base_field's prepare_value method
----------------------------------+------------------------------------

Reporter: unklphil | Owner: unklphil
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 1.8
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted

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

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

* needs_better_patch: 0 => 1
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted


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

Django

unread,
May 25, 2015, 12:07:14 PM5/25/15
to django-...@googlegroups.com
#24841: BaseRangeField should use base_field's prepare_value method
----------------------------------+------------------------------------
Reporter: unklphil | Owner: unklphil
Type: Bug | Status: closed
Component: contrib.postgres | Version: 1.8
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"614bec41b5306b32b8de20d66f047ff8d6f35256" 614bec41]:
{{{
#!CommitTicketReference repository=""
revision="614bec41b5306b32b8de20d66f047ff8d6f35256"
Fixed #24841 -- Made BaseRangeField.prepare_value() call base_field's
prepare_value()
}}}

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

Django

unread,
May 25, 2015, 1:20:03 PM5/25/15
to django-...@googlegroups.com
#24841: BaseRangeField should use base_field's prepare_value method
----------------------------------+------------------------------------
Reporter: unklphil | Owner: unklphil
Type: Bug | Status: closed
Component: contrib.postgres | Version: 1.8

Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Tim Graham <timograham@…>):

In [changeset:"4311fd2c0a5611c3103ffbae41973fd1552657a2" 4311fd2c]:
{{{
#!CommitTicketReference repository=""
revision="4311fd2c0a5611c3103ffbae41973fd1552657a2"
[1.8.x] Fixed #24841 -- Made BaseRangeField.prepare_value() call
base_field's prepare_value()

Backport of 614bec41b5306b32b8de20d66f047ff8d6f35256 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24841#comment:5>

Reply all
Reply to author
Forward
0 new messages