Opened 4 years ago

Closed 4 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: master
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 Changed 4 years ago by Simon Charette

Triage Stage: UnreviewedAccepted
Version: 1.9master

comment:2 Changed 4 years ago by Simon Charette

Patch needs improvement: set

comment:3 Changed 4 years ago by Aron Podrigal

Patch needs improvement: unset

comment:4 Changed 4 years ago by Tim Graham

Patch needs improvement: set

Simon suggests adding tests with timezone aware values.

comment:5 Changed 4 years ago by Mariusz Felisiak

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

comment:6 Changed 4 years ago by Tim Graham

Patch needs improvement: unset

comment:7 Changed 4 years ago by Tim Graham <timograham@…>

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