#25240: Current week query for DateTime fields
----------------------------------------------+----------------------------
Reporter: foresmac | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer (models, ORM) | Version: 1.8
Severity: Normal | Keywords: QuerySet.extra
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+----------------------------
Per the recommendation
[https://docs.djangoproject.com/en/1.8/ref/models/querysets/#extra here],
filling a ticket requesting that a "give me all items for the current
week" option be added to the ORM to filter `DateTime` fields. I'm using
the following extra `WHERE` clause to achieve this:
{{{#!python
where=['EXTRACT(WEEK FROM timestamp) = EXTRACT(WEEK FROM
CURRENT_TIMESTAMP)'])
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25240>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.5aa8fb21ed33770943dd2b4e2f29c9e7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.