#24189: Filtering by month or day doesn't work with MySQL
-------------------------------------+-------------------------------------
Reporter: unaizalakain | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.7
(models, ORM) | Keywords: datetime, timezone,
Severity: Normal | date, month, day
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
While filtering by year works, filtering by month or by date doesn't:
{{{
In [1]: from planner.tasks.models import KeyDate
In [2]: KeyDate.objects.all()
Out[2]: [<KeyDate: Revision>, <KeyDate: Production>]
In [3]: KeyDate.objects.all()[0].date
Out[3]: datetime.datetime(2015, 1, 20, 14, 1, 20, tzinfo=<UTC>)
In [4]: KeyDate.objects.filter(date__year=2015)
Out[4]: [<KeyDate: Revision>, <KeyDate: Production>]
In [5]: KeyDate.objects.filter(date__month=1)
Out[5]: []
}}}
If I switch to SQLite everything works as expected.
--
Ticket URL: <https://code.djangoproject.com/ticket/24189>
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/055.cc44ab9d04d02195077f6743caf24058%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.