Changes between Version 3 and Version 4 of Ticket #29840
- Timestamp:
- Oct 11, 2018, 7:28:08 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29840
- Property Status assigned → closed
- Property Resolution → invalid
-
Ticket #29840 – Description
v3 v4 1 1 I have a django query which compares datetime like this - 2 2 3 filters = {'order_created_on__gte':'2018-10-10'} 4 queryset = model.objects.filter(**filters) 5 query = str(queryset.query) 3 {{{#!python 4 filters = {'order_created_on__gte':'2018-10-10'} 5 queryset = model.objects.filter(**filters) 6 query = str(queryset.query) 7 }}} 6 8 7 9 It creates a query - select ... where order_created_on >= 2018-10-10 00:00:00 … … 13 15 Now I actually tried the following ways, but all queries give the same text in the db query 14 16 15 filters = {'order_created_on__gte':datetime(2018-10-10)} 16 filters = {'order_created_on__year__gte':2018, 'order_created_on__month__gte':10, 'order_created_on__day__gte':10} 17 {{{#!python 18 filters = {'order_created_on__gte':datetime(2018-10-10)} 19 filters = {'order_created_on__year__gte':2018, 'order_created_on__month__gte':10, 'order_created_on__day__gte':10} 20 }}} 17 21 18 22 Also used the range filter, all of the above insert this text in the final query - 19 23 20 where order_created_on >= 2018-10-10 00:00:00 24 {{{#!sql 25 where order_created_on >= 2018-10-10 00:00:00 26 }}} 21 27 22 28 Updating the time zone too didnt have any effect rather than just removing a +5:30 from the query.