mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Refs #27736 -- Used decorators for GIS lookup registration.
This commit is contained in:
parent
24d53786d4
commit
d47de2e09d
4 changed files with 39 additions and 109 deletions
|
@ -1,9 +1,8 @@
|
|||
import json
|
||||
|
||||
from django.contrib.gis.db.models.fields import BaseSpatialField
|
||||
from django.contrib.gis.db.models.functions import Distance
|
||||
from django.contrib.gis.db.models.lookups import (
|
||||
DistanceLookupBase, gis_lookups,
|
||||
)
|
||||
from django.contrib.gis.db.models.lookups import DistanceLookupBase, GISLookup
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.contrib.gis.geos import GEOSGeometry
|
||||
from django.contrib.gis.measure import D
|
||||
|
@ -130,7 +129,9 @@ class RasterFieldTest(TransactionTestCase):
|
|||
stx_pnt.transform(3086)
|
||||
|
||||
# Loop through all the GIS lookups.
|
||||
for name, lookup in gis_lookups.items():
|
||||
for name, lookup in BaseSpatialField.get_lookups().items():
|
||||
if not isinstance(lookup, GISLookup):
|
||||
continue
|
||||
# Construct lookup filter strings.
|
||||
combo_keys = [
|
||||
field + name for field in [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue