#32449: Allow specifying tables in RawSQL().
-------------------------------------+-------------------------------------
Reporter: João Carneiro Haas | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: annotate, count, | Triage Stage:
RawSQL, select_related, JOIN | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by João Carneiro Haas):
Replying to [comment:4 Mariusz Felisiak]:
> We have an accepted ticket for CTE, see #28919.
Yeah, I believe this will end up solving my issue.
> There is no need for a new API, because resolving #28477 will strip
unused annotation, so crash is a duplicate of #28477
The crash will still occur even after #28477 is fixed, since you can (and
probably will) use the annotation on other statements which will influence
`count`:
{{{
#!python
b_qs =
b_qs.objects.annotate(graph_child_count=RawSQL(...)).filter(graph_child_count__lt=10).count()
}}}
So yeah, the CTE ticket solves our specific issue, although I still
believe this feature would be useful for other non-supported Django stuff
which require a `RawSQL`.
--
Ticket URL: <https://code.djangoproject.com/ticket/32449#comment:5>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.14b7bc440f6d32c499486c46b11b188b%40djangoproject.com.