#24841 closed Bug (fixed)
BaseRangeField should use base_field's prepare_value method
Reported by: | Villiers Strauss | Owned by: | Villiers Strauss |
---|---|---|---|
Component: | contrib.postgres | Version: | 1.8 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | yes | UI/UX: | no |
Description
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.
Change History (5)
comment:1 by , 9 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Patch needs improvement: | set |
---|---|
Severity: | Normal → Release blocker |
Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
Pull request: https://github.com/django/django/pull/4695