Changes between Initial Version and Version 1 of Ticket #35603, comment 1


Ignore:
Timestamp:
Jul 15, 2024, 9:41:42 PM (4 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35603, comment 1

    initial v1  
    2121
    2222which explains why it hangs indefinitely.
     23
     24Implementing `__contains__` resolves the issue
     25
     26{{{#!diff
     27diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py
     28index dcba973ff4..0e4d259fa3 100644
     29--- a/django/db/models/expressions.py
     30+++ b/django/db/models/expressions.py
     31@@ -884,6 +884,9 @@ def __repr__(self):
     32     def __getitem__(self, subscript):
     33         return Sliced(self, subscript)
     34
     35+    def __contains__(self, other):
     36+        return False
     37+
     38     def resolve_expression(
     39         self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False
     40     ):
     41}}}
Back to Top