#28621: WHERE NOT EXISTS (... ~ ...) without extra() ? --------------------------------+-------------------------------------- Reporter: Дилян Палаузов | Owner: nobody Type: Uncategorized | Status: closed Component: Uncategorized | Version: 1.11 Severity: Normal | Resolution: invalid Keywords: QuerySet.extra | Triage Stage: Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 --------------------------------+-------------------------------------- Changes (by Simon Charette):
* status: new => closed * resolution: => invalid Comment: I think you can use the `Exists` [https://docs.djangoproject.com/en/1.11/ref/models/expressions/#exists- subqueries expression available since Django 1.11] {{{#!python from django.db.models import Exists, F, OuterRef A.objects.annotate( not_matches=~Exists( B.objects.annotate( tag=OuterRef('tag'), ).filter(tag__regex=F('pattern')), ), ).filter(not_matches=True) }}} Please re-open if this doesn't work. -- Ticket URL: <https://code.djangoproject.com/ticket/28621#comment:1> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/072.2e890c3ac5687baa5305ccf672ba3a43%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.