1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Converted GIS lookups to use the new Lookup API

Thanks Tim Graham, Anssi Kääriäinen and Marc Tamlyn for the
reviews.
This commit is contained in:
Claude Paroz
2014-05-22 21:51:30 +02:00
parent 4ef9618e12
commit 2bd1bbc424
11 changed files with 410 additions and 487 deletions

View File

@@ -244,6 +244,12 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations):
else:
return 'SDO_GEOMETRY(%%s, %s)' % f.srid
def check_relate_argument(self, arg):
masks = 'TOUCH|OVERLAPBDYDISJOINT|OVERLAPBDYINTERSECT|EQUAL|INSIDE|COVEREDBY|CONTAINS|COVERS|ANYINTERACT|ON'
mask_regex = re.compile(r'^(%s)(\+(%s))*$' % (masks, masks), re.I)
if not self.mask_regex.match(arg):
raise ValueError('Invalid SDO_RELATE mask: "%s"' % (self.relate_func, arg))
def spatial_lookup_sql(self, lvalue, lookup_type, value, field, qn):
"Returns the SQL WHERE clause for use in Oracle spatial SQL construction."
geo_col, db_type = lvalue