possible implementation of st_dwithin, thanks User
This commit is contained in:
2
VERSION
2
VERSION
@@ -1 +1 @@
|
||||
Version 2.8.2-stable+timestamp.2013.12.08.09.32.29
|
||||
Version 2.8.2-stable+timestamp.2013.12.09.17.05.33
|
||||
|
||||
@@ -2980,11 +2980,12 @@ class PostgreSQLAdapter(BaseAdapter):
|
||||
"""
|
||||
return 'ST_Within(%s,%s)' %(self.expand(first), self.expand(second, first.type))
|
||||
|
||||
def ST_DWITHIN(self, first, second):
|
||||
def ST_DWITHIN(self, first, (second, third)):
|
||||
"""
|
||||
http://postgis.org/docs/ST_Within.html
|
||||
"""
|
||||
return 'ST_DWithin(%s,%s)' %(self.expand(first), self.expand(second, first.type))
|
||||
return 'ST_DWithin(%s,%s)' %(self.expand(first), self.expand(second, first.type),
|
||||
self.expand(third, 'double'))
|
||||
|
||||
def represent(self, obj, fieldtype):
|
||||
field_is_type = fieldtype.startswith
|
||||
@@ -9674,6 +9675,10 @@ class Expression(object):
|
||||
db = self.db
|
||||
return Query(db, db._adapter.ST_WITHIN, self, value)
|
||||
|
||||
def st_dwithin(self, value, distance):
|
||||
db = self.db
|
||||
return Query(db, db._adapter.ST_DWITHIN, self, (value, distance))
|
||||
|
||||
# for use in both Query and sortby
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user