Changes between Initial Version and Version 2 of Ticket #24991


Ignore:
Timestamp:
Aug 6, 2015, 2:23:37 AM (9 years ago)
Author:
Villiers Strauss
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24991

    • Property Triage Stage UnreviewedAccepted
    • Property Type UncategorizedBug
  • Ticket #24991 – Description

    initial v2  
    77>>> from myapp.models import MyModel  # model defintion is irrelevant
    88
    9 >>> print(MyModel.objects.filter(num_rng__overlap=NumericRange(1, 5)))
     9>>> print(MyModel.objects.filter(num_rng__overlap=NumericRange(1, 5)).query)
    1010SELECT [...] FROM "myapp_mymodel" WHERE ("myapp_mymodel"."num_rng" && NumericRange(1, 5, '[)'))
    1111
    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)
    1313SELECT [...] FROM "myapp_mymodel" WHERE ("myapp_mymodel"."date_rng" && DateRange(datetime.date(2015, 5, 1), datetime.date(2015, 6, 1), '[)'))
    1414
    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)
    1616SELECT [...] 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>), '[)'))
    1717}}}
Back to Top