I am trying to use a Dajngo QuerySet where I have to format time_stamp field in .values ('time_stamp')
.
In PostgreSql I can dot like this:
GROUP BY time_stamp::date
I have to do this because in the date column the format (2018-01-22 00:00:28+01) show time as well and I want know the average of the filed only in ONE day.
So my main question how can I create a query in Django which equal with this PostgreSQL query.
SELECT avg(field) FROM table GROUP BY time_stamp::date