|
5 | 5 | BuiltinLookup,
|
6 | 6 | Contains,
|
7 | 7 | Exact,
|
8 |
| - IntegerFieldOverflow, |
9 | 8 | IsNull,
|
10 | 9 | )
|
11 | 10 | from django.db.models.sql.where import AND, XOR, WhereNode
|
@@ -71,19 +70,6 @@ def exact(self, compiler, connection):
|
71 | 70 | return {"$expr": {"$eq": [lhs_mql, value]}}
|
72 | 71 |
|
73 | 72 |
|
74 |
| -def integer_field_overflow(self, compiler, connection): |
75 |
| - rhs = self.rhs |
76 |
| - if isinstance(rhs, int): |
77 |
| - field_internal_type = self.lhs.output_field.get_internal_type() |
78 |
| - min_value, max_value = connection.ops.integer_field_range(field_internal_type) |
79 |
| - if min_value is not None and rhs < min_value: |
80 |
| - raise self.underflow_exception |
81 |
| - if max_value is not None and rhs > max_value: |
82 |
| - raise self.overflow_exception |
83 |
| - |
84 |
| - return super(IntegerFieldOverflow, self).as_mql(compiler, connection) |
85 |
| - |
86 |
| - |
87 | 73 | def contains(self, compiler, connection):
|
88 | 74 | lhs_mql = process_lhs(self, compiler, connection)
|
89 | 75 | value = process_rhs(self, compiler, connection)
|
@@ -117,5 +103,4 @@ def register_lookups():
|
117 | 103 | Contains.as_mql = contains
|
118 | 104 | In.as_mql = in_
|
119 | 105 | RelatedIn.as_mql = in_
|
120 |
| - IntegerFieldOverflow.as_mql = integer_field_overflow |
121 | 106 | BuiltinLookup.as_mql = builtin_lookup
|
0 commit comments