Changes between Version 1 and Version 2 of Ticket #32554


Ignore:
Timestamp:
Mar 19, 2021, 3:13:59 PM (3 years ago)
Author:
jonathan-golorry
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32554 – Description

    v1 v2  
     1`Q.empty()` checks for nested empty Q objects such as `Q(Q())`. See #32549 for rationale.
     2
    13`Q.FALSE` and `Q.TRUE` are classattribute aliases for `Q(pk__in=[])` and `~Q(pk__in=[])`.
    24
    35`Q.any()` and `Q.all()` mimic python's builtin `any` and `all`, defaulting to `Q.FALSE` and `Q.TRUE` for empty iterators (or iterators containing only empty Q objects).
    46
    5 Patch: https://github.com/django/django/pull/14131
     7Patch: https://github.com/django/django/pull/14159
    68
    79See this forum thread discussing why these are an improvement over many ad-hoc implementations people are using: https://forum.djangoproject.com/t/improving-q-objects-with-true-false-and-none/851
    8 
    9 My patch relies on https://code.djangoproject.com/ticket/32548 and https://code.djangoproject.com/ticket/32549. I kept those as separate tickets because they each had side effects that warranted their own discussion.
Back to Top