#25113: Field lookup for __not_in -------------------------------------+------------------------------------- Reporter: Evan Tschuy | Owner: nobody Type: New feature | Status: closed Component: Database layer | Version: master (models, ORM) | Severity: Normal | Resolution: wontfix Keywords: | Triage Stage: | Unreviewed Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Timothy Allen): I ran into this same issue. As the comment above points out, `NOT (id IN ())` is not equivalent to `id NOT IN ()`. Details of my issue and attempts are here: https://stackoverflow.com/questions/60671987/django-orm-equivalent-of-sql- not-in-exclude-and-q-objects-do-not-work The solution provided on that post, and another provided on Django's forum, seem like a reasonable addition to Django. Lacking support for the equivalent of SQL's `id NOT IN (1, 2, 3)` is a hole in the ORM feature set, especially now that we have `Subquery`. -- Ticket URL: <https://code.djangoproject.com/ticket/25113#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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.588755c37198ea79c7468656b6d03b5e%40djangoproject.com.