Opened 6 years ago

Closed 6 years ago

#29668 closed Bug (invalid)

missing FROM-clause entry in subquery with extra — at Version 5

Reported by: pranavneeraj Owned by: nobody
Component: Database layer (models, ORM) Version: 2.0
Severity: Normal Keywords:
Cc: Mariusz Felisiak Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

Turn.active_objects.all().select_related('request__address').extra(select={'start_time_tz': '(start_time AT TIME ZONE COALESCE("api_address".timezone))'}).distinct() Works but Turn.active_objects.all().select_related('request__address').extra(select={'start_time_tz': '(start_time AT TIME ZONE COALESCE("api_address".timezone))'}).distinct().count() doesn't.

Because count executes subquery.

Change History (5)

comment:1 by pranavneeraj, 6 years ago

Version is 1.9.

comment:2 by pranavneeraj, 6 years ago

Component: UncategorizedDatabase layer (models, ORM)

comment:3 by pranavneeraj, 6 years ago

Severity: NormalRelease blocker

comment:4 by Mariusz Felisiak, 6 years ago

Cc: Mariusz Felisiak added
Severity: Release blockerNormal

I wouldn't mark this as a release blocker if it is there since Django 1.9. Have you confirmed that issue appears in the supported versions e.g. 2.0 or 2.1?

comment:5 by Tim Graham, 6 years ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

Even if it's still an issue, we're no longer fixing bugs with QuerySet.extra() per discussion on django-developers.

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