Skip to content

Commit 45f3a87

Browse files
committed
Q expression always came from a column, so we don't need to check if it is.
1 parent 457d428 commit 45f3a87

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

django_mongodb/indexes.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from django.core.exceptions import EmptyResultSet, FullResultSet
22
from django.db import NotSupportedError
33
from django.db.models import Index
4-
from django.db.models.expressions import Col
54
from django.db.models.fields.related_lookups import In
65
from django.db.models.lookups import BuiltinLookup
76
from django.db.models.sql.query import Query
@@ -28,8 +27,6 @@ def _get_condition_mql(self, model, schema_editor):
2827

2928

3029
def builtin_lookup_idx(self, compiler, connection):
31-
if not isinstance(self.lhs, Col):
32-
raise NotSupportedError("Expressions as indexes are not supported.")
3330
lhs_mql = self.lhs.target.column
3431
value = process_rhs(self, compiler, connection)
3532
try:

0 commit comments

Comments
 (0)