예제 #1
0
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)
예제 #2
0
def run_nearby():
    tr = Trace.objects.get(id=1)
    Trace.get_closest_tracks(tr, 40, 0)
예제 #3
0
파일: test.py 프로젝트: Nucleoos/serpentine
def run_nearby():
    tr = Trace.objects.get(id=1)
    Trace.get_closest_tracks(tr, 40,0)