def nearby(request): c = {} lat, lon, tr_id = 0, 0, 0 if request.method == 'GET': #DONE tester l'existence des cles lat, lon, tr_id = 0, 0, 0 if request.GET.has_key('lat'): lat = float(request.GET['lat']) if request.GET.has_key('lon'): lon = float(request.GET['lon']) if request.GET.has_key('tr_id'): tr_id = int(request.GET['tr_id']) closest = Trace.get_closest_tracks(tr_id, lat, lon) c['closest_tracks'] = closest c['tr_id'] = tr_id return render_to_response('gps/nearby.html', c)
def run_nearby(): tr = Trace.objects.get(id=1) Trace.get_closest_tracks(tr, 40, 0)
def run_nearby(): tr = Trace.objects.get(id=1) Trace.get_closest_tracks(tr, 40,0)