Skip to content

Commit 175f3cd

Browse files
committed
ADd supports_dwithin_distance_expr=False and better subquery error
1 parent 924523e commit 175f3cd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

django_mongodb_backend/gis/features.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class GISFeatures(BaseSpatialFeatures):
66
has_spatialrefsys_table = False
77
supports_distance_geodetic = False
88
supports_transform = False
9+
supports_dwithin_distance_expr = False
910

1011
@cached_property
1112
def django_test_expected_failures(self):
@@ -50,9 +51,6 @@ def django_test_skips(self):
5051
# Error: Index already exists with a different name
5152
"gis_tests.geoapp.test_indexes.SchemaIndexesTests.test_index_name",
5253
},
53-
"Cannot use a non-Point geometry with distance lookups.": {
54-
"gis_tests.distapp.tests.DistanceTest.test_dwithin_with_expression_rhs"
55-
},
5654
"Subqueries not supported.": {
5755
"gis_tests.geoapp.tests.GeoLookupTest.test_subquery_annotation",
5856
"gis_tests.geoapp.tests.GeoQuerySetTest.test_within_subquery",

django_mongodb_backend/gis/lookups.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ def gis_lookup(self, compiler, connection, as_expr=False):
99
raise NotSupportedError("MongoDB does not support GIS lookups as expressions.")
1010
lhs_mql = process_lhs(self, compiler, connection, as_expr=as_expr)
1111
rhs_mql = process_rhs(self, compiler, connection, as_expr=as_expr)
12+
if "subquery" in rhs_mql or "subquery" in lhs_mql:
13+
raise NotSupportedError("MongoDB does not support GIS lookups with subqueries.")
1214
try:
1315
rhs_op = self.get_rhs_op(connection, rhs_mql)
1416
except KeyError as e:

0 commit comments

Comments
 (0)