You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When requesting data that's filtered on a "Date range" of "last week", I get a warning in the Django console:
.../.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1393:
RuntimeWarning: DateTimeField Asset.date_added received a naive datetime
(2018-02-08 00:00:00) while time zone support is active.
The reason is that the _truncate function removes time zone info. I am about to open a Pull Request with code that fixes this.
The text was updated successfully, but these errors were encountered:
Currently DateRangeFilter only really works with DateFields. _truncate is meant to return a date. When that gets converted to a datetime you're not going to have tzinfo.
Your change in #874 has _truncate return a datetime, which is leading to the failure in the filtering for the object create today in the week filtering test. (Exactly why that's not giving the right result would be interesting: what's the zero-hour datetime getting converted back to a date as? — but I haven't had a chance to look at that.)
There shouldn't be any reason this should work both ways. (Django's ChangeList manages it I think.) So I'd be very happy to look a PR solving the issues here.
When requesting data that's filtered on a "Date range" of "last week", I get a warning in the Django console:
The reason is that the
_truncate
function removes time zone info. I am about to open a Pull Request with code that fixes this.The text was updated successfully, but these errors were encountered: