Changes between Initial Version and Version 2 of Ticket #24991
- Timestamp:
- Aug 6, 2015, 2:23:37 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24991
- Property Triage Stage Unreviewed → Accepted
- Property Type Uncategorized → Bug
-
Ticket #24991 – Description
initial v2 7 7 >>> from myapp.models import MyModel # model defintion is irrelevant 8 8 9 >>> print(MyModel.objects.filter(num_rng__overlap=NumericRange(1, 5)) )9 >>> print(MyModel.objects.filter(num_rng__overlap=NumericRange(1, 5)).query) 10 10 SELECT [...] FROM "myapp_mymodel" WHERE ("myapp_mymodel"."num_rng" && NumericRange(1, 5, '[)')) 11 11 12 >>> print(MyModel.objects.filter(date_rng__overlap=DateRange(datetime.date(2015, 5, 1), datetime.date(2015, 6, 1))) )12 >>> print(MyModel.objects.filter(date_rng__overlap=DateRange(datetime.date(2015, 5, 1), datetime.date(2015, 6, 1))).query) 13 13 SELECT [...] FROM "myapp_mymodel" WHERE ("myapp_mymodel"."date_rng" && DateRange(datetime.date(2015, 5, 1), datetime.date(2015, 6, 1), '[)')) 14 14 15 >>> print(MyModel.objects.filter(dt_rng__overlap=DateTimeTZRange(datetime.datetime(2015, 5, 1, tzinfo=utc), datetime.datetime(2015, 6, 1, tzinfo=utc))) )15 >>> print(MyModel.objects.filter(dt_rng__overlap=DateTimeTZRange(datetime.datetime(2015, 5, 1, tzinfo=utc), datetime.datetime(2015, 6, 1, tzinfo=utc))).query) 16 16 SELECT [...] FROM "myapp_mymodel" WHERE ("myapp_mymodel"."dt_rng" && DateTimeTZRange(datetime.datetime(2015, 5, 1, 0, 0, tzinfo=<UTC>), datetime.datetime(2015, 6, 1, 0, 0, tzinfo=<UTC>), '[)')) 17 17 }}}