{{{
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.
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
After injecting timezone definitions it didn't work neither... until I
restarted the MySQL server.
--
Ticket URL: <https://code.djangoproject.com/ticket/24189#comment:1>
Comment (by aaugustin):
MySQL thinks it's a good idea to return invalid results silently when
something goes wrong. I'm sorry to hear that you have to use it.
--
Ticket URL: <https://code.djangoproject.com/ticket/24189#comment:2>
Comment (by unaizalakain):
Replying to [comment:2 aaugustin]:
> MySQL thinks it's a good idea to return invalid results silently when
something goes wrong. I'm sorry to hear that you have to use it.
I'm sorry too, believe me, it's the first time I had to use MySQL and,
compared to using PostgreSQL it's not a pleasant experience ... I hope we
will eventually change to PostgreSQL...
--
Ticket URL: <https://code.djangoproject.com/ticket/24189#comment:3>