#24991: Range types not properly converted to SQL in QuerySet.query.__str__()
----------------------------------+----------------------------------------
Reporter: unklphil | Owner: Stranger6667
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+----------------------------------------
Comment (by Stranger6667):
Based on `psycopg2.extensions.adapt` output it should be converted as:
`NumericRange(1, 5)` to `'[1,5)'`
`DateRange(datetime.date(2015, 5, 1), datetime.date(2015, 6, 1))` to
`daterange('2015-05-01'::date, '2015-06-01'::date, '[)')`
`DateTimeTZRange(datetime.datetime(2015, 5, 1, tzinfo=utc),
datetime.datetime(2015, 6, 1, tzinfo=utc))` to
`tstzrange('2015-05-01T00:00:00+00:00'::timestamptz,
'2015-06-01T00:00:00+00:00'::timestamptz, '[)')`
Please correct me if I'm wrong. If it is true, then I'll try to provide PR
for that.
--
Ticket URL: <https://code.djangoproject.com/ticket/24991#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.3eda472feb9c5c956e1b9c4d5da54503%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.