find() returns only records with is_primary=True.
This commit is contained in:
parent
4d578c156d
commit
171caadf0d
|
@ -24,8 +24,8 @@ class FeatureSearchManager(models.GeoManager):
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
cursor.execute("""SELECT set_limit(%f)""" % threshold)
|
cursor.execute("""SELECT set_limit(%f)""" % threshold)
|
||||||
|
|
||||||
def find(self, bbox=None, text=None, adm1=None, adm2=None, threshold=0.5, srid=4326):
|
def find(self, bbox=None, text=None, adm1=None, adm2=None, is_primary=True, threshold=0.5, srid=4326):
|
||||||
qset = self.get_query_set()
|
qset = self.get_query_set().filter(is_primary=is_primary)
|
||||||
if bbox:
|
if bbox:
|
||||||
(minx, miny, maxx, maxy) = bbox
|
(minx, miny, maxx, maxy) = bbox
|
||||||
bbox = Polygon(((minx,miny),(minx,maxy),(maxx,maxy),(maxx,miny),(minx,miny)),srid=srid)
|
bbox = Polygon(((minx,miny),(minx,maxy),(maxx,maxy),(maxx,miny),(minx,miny)),srid=srid)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user