#32549: Add `Q.empty()` to check for nested empty Q objects like `Q(Q())`
-------------------------------------+-------------------------------------
Reporter: jonathan-golorry | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: Q objects, nested, | Triage Stage:
empty | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by jonathan-golorry):
Replying to [comment:6 Ian Foote]:
> I'm persuaded that this is a problem. Accidentally leaking data because
we treat {{{Q(Q())}}} differently to {{{Q()}}} feels like a bug to me, so
fixing it shouldn't be blocked by backwards compatibility arguments.
#32554 does a lot more to prevent accidentally leaking data. If that's the
only concern, I think it's better to roll `Q.empty()` into that patch.
This ticket is primarily about whether or not to shortcut logical
operations between nested empty Q objects.
--
Ticket URL: <https://code.djangoproject.com/ticket/32549#comment:7>
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/074.3cceb40b1172590c3ba9e2649989f027%40djangoproject.com.