whatisnear
This commit is contained in:
@@ -16,6 +16,8 @@ def howfaris(lat_lon,course):
|
||||
|
||||
return distance
|
||||
|
||||
whatisnear = 150
|
||||
|
||||
# get nearest races
|
||||
def getnearestraces(lat_lon,races):
|
||||
newlist = []
|
||||
@@ -27,7 +29,7 @@ def getnearestraces(lat_lon,races):
|
||||
c = race.course
|
||||
coords = c.coord
|
||||
distance = howfaris(lat_lon,c)
|
||||
if distance < 100:
|
||||
if distance < whatisnear:
|
||||
newlist.append(race)
|
||||
counter += 1
|
||||
|
||||
@@ -39,7 +41,7 @@ def getnearestraces(lat_lon,races):
|
||||
orders = sorted(orders,key = lambda tup:tup[1])
|
||||
ids = [id for id,distance in orders[0:4]]
|
||||
for id, distance in orders[5:]:
|
||||
if distance<100:
|
||||
if distance<whatisnear:
|
||||
ids.append(id)
|
||||
|
||||
for id in ids:
|
||||
@@ -54,7 +56,7 @@ def getnearestcourses(lat_lon,courses):
|
||||
for c in courses:
|
||||
coords = c.coord
|
||||
distance = howfaris(lat_lon,c)
|
||||
if distance < 100:
|
||||
if distance < whatisnear:
|
||||
newlist.append(c)
|
||||
counter += 1
|
||||
|
||||
@@ -65,7 +67,7 @@ def getnearestcourses(lat_lon,courses):
|
||||
orders = sorted(orders,key = lambda tup:tup[1])
|
||||
ids = [id for id,distance in orders[0:4]]
|
||||
for id, distance in orders[5:]:
|
||||
if distance<100:
|
||||
if distance<whatisnear:
|
||||
ids.append(id)
|
||||
|
||||
for id in ids:
|
||||
@@ -1337,7 +1339,7 @@ def virtualevent_view(request,id=0):
|
||||
orderby = request.GET.get('order_by')
|
||||
if orderby not in allowed:
|
||||
orderby = None
|
||||
|
||||
|
||||
if orderby is not None:
|
||||
try:
|
||||
results = results.order_by(orderby)
|
||||
|
||||
Reference in New Issue
Block a user