Opened 8 years ago

Closed 8 years ago

#26903 closed Bug (fixed)

support date and timestamp containment within postgres range field

Reported by: Aron Podrigal Owned by: Mariusz Felisiak
Component: contrib.postgres Version: dev
Severity: Normal Keywords: rangefield
Cc: felisiak.mariusz@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

currently trying to do a lookup

MyModel.objects.filter(datetime_range__contains=timezone.now())

results in incorrect SQL.

Pull request at https://github.com/django/django/pull/6885

Change History (7)

comment:1 by Simon Charette, 8 years ago

Triage Stage: UnreviewedAccepted
Version: 1.9master

comment:2 by Simon Charette, 8 years ago

Patch needs improvement: set

comment:3 by Aron Podrigal, 8 years ago

Patch needs improvement: unset

comment:4 by Tim Graham, 8 years ago

Patch needs improvement: set

Simon suggests adding tests with timezone aware values.

comment:5 by Mariusz Felisiak, 8 years ago

Cc: felisiak.mariusz@… added
Owner: set to Mariusz Felisiak
Status: newassigned

comment:6 by Tim Graham, 8 years ago

Patch needs improvement: unset

comment:7 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 6b048b36:

Fixed #26903 -- Fixed contains lookup for Date/DateTimeRangeField.

Thanks Mariusz Felisiak and Tim Graham for polishing the patch.

Note: See TracTickets for help on using tickets.
Back to Top