Skip to content

Commit 595c908

Browse files
committed
some issues triaged
1 parent e26ee4f commit 595c908

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
from .functions import register_functions
2+
from .lookups import register_lookups
23

34
register_functions()
5+
register_lookups()

django_mongodb_backend_gis/features.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,10 @@ def django_test_expected_failures(self):
1616
# SRIDs aren't supported.
1717
"gis_tests.geogapp.tests.GeographyTest.test05_geography_layermapping",
1818
"gis_tests.geoapp.tests.GeoModelTest.test_proxy",
19-
# 'WithinLookup' object has no attribute 'as_mql'
20-
# "gis_tests.relatedapp.tests.RelatedGeoModelTest.test10_combine",
2119
# GEOSException: Calling transform() with no SRID set is not supported
2220
"gis_tests.relatedapp.tests.RelatedGeoModelTest.test06_f_expressions",
2321
# 'Adapter' object has no attribute 'srid'
2422
"gis_tests.geoapp.test_expressions.GeoExpressionsTests.test_geometry_value_annotation",
25-
# To triage:
26-
"gis_tests.geoapp.test_expressions.GeoExpressionsTests.test_multiple_annotation",
27-
# 'ContainsLookup' object has no attribute 'as_mql'.
28-
"gis_tests.geoapp.test_regress.GeoRegressionTests.test_empty_count",
29-
"gis_tests.geoapp.tests.GeoLookupTest.test_contains_contained_lookups",
3023
# Object of type ObjectId is not JSON serializable
3124
"gis_tests.geoapp.test_serializers.GeoJSONSerializerTests.test_fields_option",
3225
# LinearRing requires at least 4 points, got 1.
@@ -36,14 +29,9 @@ def django_test_expected_failures(self):
3629
"gis_tests.geoapp.test_serializers.GeoJSONSerializerTests.test_id_field_option",
3730
"gis_tests.geoapp.test_serializers.GeoJSONSerializerTests.test_serialization_base",
3831
"gis_tests.geoapp.test_serializers.GeoJSONSerializerTests.test_srid_option",
39-
# 'DisjointLookup' object has no attribute 'as_mql'
40-
"gis_tests.geoapp.tests.GeoLookupTest.test_disjoint_lookup",
41-
# 'SameAsLookup' object has no attribute 'as_mql'
42-
"gis_tests.geoapp.tests.GeoLookupTest.test_equals_lookups",
43-
# 'WithinLookup' object has no attribute 'as_mql'
44-
"gis_tests.geoapp.tests.GeoLookupTest.test_subquery_annotation",
45-
"gis_tests.geoapp.tests.GeoQuerySetTest.test_within_subquery",
46-
# issubclass() arg 1 must be a class
32+
# GeometryField is not supported (the type of Geometry isn't
33+
# stored so that it can be initialized by the database converter).
34+
# Error in database converter: issubclass() arg 1 must be a class
4735
"gis_tests.geoapp.tests.GeoModelTest.test_geometryfield",
4836
# KeyError: 'within' connection.ops.gis_operators[self.lookup_name]
4937
"gis_tests.geoapp.tests.GeoModelTest.test_gis_query_as_string",

django_mongodb_backend_gis/lookups.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from django.contrib.gis.db.models.lookups import GISLookup
2+
from django.db import NotSupportedError
3+
4+
5+
def gis_lookup(self, compiler, connection): # noqa: ARG001
6+
raise NotSupportedError(f"MongoDB does not support the {self.lookup_name} lookup.")
7+
8+
9+
def register_lookups():
10+
GISLookup.as_mql = gis_lookup

0 commit comments

Comments
 (0)