#29789: Support nested relations in FilteredRelation's condition
-------------------------------------+-------------------------------------
Reporter: Thomas | Owner: nobody
Riccardi |
Type: New | Status: new
feature |
Component: Database | Version: 2.0
layer (models, ORM) | Keywords: FilteredRelation
Severity: Normal | nested relations
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
As the documentation explains, FilteredRelation's condition do not support
nested relations:
{{{
>>> Restaurant.objects.annotate(
... pizzas_with_toppings_startswith_n=FilteredRelation(
... 'pizzas__toppings',
... condition=Q(pizzas__toppings__name__startswith='n'),
... ),
... )
Traceback (most recent call last):
...
ValueError: FilteredRelation's condition doesn't support nested
relations (got 'pizzas__toppings__name__startswith').
}}}
It would be great to support nested relations in FilteredRelation's
condition (I encountered this limitation multiple times recently).
--
Ticket URL: <https://code.djangoproject.com/ticket/29789>
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/058.1f2f088eb91c1652e51b49e676750666%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.