Changes between Version 1 and Version 2 of Ticket #34597, comment 2


Ignore:
Timestamp:
May 28, 2023, 10:28:09 AM (18 months ago)
Author:
Lorand Varga

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34597, comment 2

    v1 v2  
    119119
    120120The only synthax that manages (in django 3.2) to replicate the query correctly (and performance wise as in django2.2) seems to be
    121 {{{qs.exclude(id__in=Blog.objects.filter(translation=None, id=OuterRef("id")))}}}
     121{{{
     122Blog.objects.filter(is_published=True, api_has_translation=False).exclude(id__in=Blog.objects.filter(translation=None, id=OuterRef("id")))
     123}}}
    122124
    123125While not terrible I do think something has been broken in django since the ~Q(translation=None) seems a lot cleaner and more ORMish.
Back to Top