Python Django ORM brackets in query
Just start to learn django and have got an issue. I trying to use filter in my view but unfortunately it doesn't work.
This what I try to do:
queryset.filter(date__range=[startDate,endDate])
It is a query which django generated :
SELECT
"dashboard_sales"."id",
"dashboard_sales"."department_id",
"dashboard_sales"."value",
"dashboard_sales"."date"
FROM
"dashboard_sales"
WHERE
"dashboard_sales"."date" BETWEEN 2019-01-01 AND 2030-01-01
The issue is django doesn't wrap date in brackets. So the correct query should has '2019-01-01' not just 2019-01-01. Does anybody nows how to fix it?
Thank you very much !