﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29840	DJANGO query generated by ORM is invalid	Arjunsingh	Arjunsingh	"I have a django query which compares datetime like this - 

    filters = {'order_created_on__gte':'2018-10-10'}
    queryset = model.objects.filter(**filters)
    query = str(queryset.query)

It creates a query  - select ... where order_created_on >= 2018-10-10 00:00:00

When fired on postgres, it gives an error - syntax error at or near ""00"".

If I fire the same query in db manually by replacing the date by '2018-10-10' it works.

Now I actually tried the following ways, but all queries give the same text in the db query 

    filters = {'order_created_on__gte':datetime(2018-10-10)}
    filters = {'order_created_on__year__gte':2018, 'order_created_on__month__gte':10, 'order_created_on__day__gte':10}

Also used the range filter, all of the above insert this text in the final query - 

    where order_created_on >= 2018-10-10 00:00:00

Updating the time zone too didnt have any effect rather than just removing a +5:30 from the query.
And the UI over here aint showing 'double underscore''s used in filters"	Bug	assigned	Database layer (models, ORM)	2.1	Normal		django orm query		Unreviewed	0	0	0	0	0	0
