Re: [Django] #31506: Clarify that ExpressionWrapper is not the tool to use when coping with DateField and timedelta arithmetic quirks on PostgreSQL and MySQL

4 views
Skip to first unread message

Django

unread,
Nov 26, 2025, 8:27:12 AM (4 days ago) Nov 26
to django-...@googlegroups.com
#31506: Clarify that ExpressionWrapper is not the tool to use when coping with
DateField and timedelta arithmetic quirks on PostgreSQL and MySQL
-------------------------------------+-------------------------------------
Reporter: Matthieu Rigal | Owner: Hwayoung
Type: | Cha
Cleanup/optimization | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin

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

Django

unread,
Nov 26, 2025, 8:33:34 AM (4 days ago) Nov 26
to django-...@googlegroups.com
#31506: Clarify that ExpressionWrapper is not the tool to use when coping with
DateField and timedelta arithmetic quirks on PostgreSQL and MySQL
-------------------------------------+-------------------------------------
Reporter: Matthieu Rigal | Owner: Hwayoung
Type: | Cha
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):

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

Comment:

In [changeset:"55af4749b9a48b2978e893e7d7be313c0b2abdb1" 55af4749]:
{{{#!CommitTicketReference repository=""
revision="55af4749b9a48b2978e893e7d7be313c0b2abdb1"
Fixed #31506 -- Clarified that ExpressionWrapper does not perform database
casts.

Added warning in DateField documentation about type differences when using
timedelta on PostgreSQL and MySQL. Mentioned Cast() and integer arithmetic
solutions.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31506#comment:15>

Django

unread,
Nov 26, 2025, 8:35:54 AM (4 days ago) Nov 26
to django-...@googlegroups.com
#31506: Clarify that ExpressionWrapper is not the tool to use when coping with
DateField and timedelta arithmetic quirks on PostgreSQL and MySQL
-------------------------------------+-------------------------------------
Reporter: Matthieu Rigal | Owner: Hwayoung
Type: | Cha
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"122b2dc569bb2074367188621e1acd87f35d91a1" 122b2dc]:
{{{#!CommitTicketReference repository=""
revision="122b2dc569bb2074367188621e1acd87f35d91a1"
[6.0.x] Fixed #31506 -- Clarified that ExpressionWrapper does not perform
database casts.

Added warning in DateField documentation about type differences when using
timedelta on PostgreSQL and MySQL. Mentioned Cast() and integer arithmetic
solutions.

Backport of 55af4749b9a48b2978e893e7d7be313c0b2abdb1 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31506#comment:16>

Django

unread,
Nov 26, 2025, 8:36:51 AM (4 days ago) Nov 26
to django-...@googlegroups.com
#31506: Clarify that ExpressionWrapper is not the tool to use when coping with
DateField and timedelta arithmetic quirks on PostgreSQL and MySQL
-------------------------------------+-------------------------------------
Reporter: Matthieu Rigal | Owner: Hwayoung
Type: | Cha
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"31bc5c2d11e1d1cc728666d0785eea088b1dc1f2" 31bc5c2d]:
{{{#!CommitTicketReference repository=""
revision="31bc5c2d11e1d1cc728666d0785eea088b1dc1f2"
[5.2.x] Fixed #31506 -- Clarified that ExpressionWrapper does not perform
database casts.

Added warning in DateField documentation about type differences when using
timedelta on PostgreSQL and MySQL. Mentioned Cast() and integer arithmetic
solutions.

Backport of 55af4749b9a48b2978e893e7d7be313c0b2abdb1 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31506#comment:17>
Reply all
Reply to author
Forward
0 new messages