mirror of
https://github.com/django/django.git
synced 2025-12-18 06:41:50 +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:
parent
4ef9618e12
commit
2bd1bbc424
11 changed files with 410 additions and 487 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue