@same_origin
def route_realtime(route_id):
    # Only get "recent" buses
    current = timedelta(hours=1) - datetime.now()
    qs = Bus.objects.filter(route=route_id,
                            status_time__gte=current,
                            is_stale=False)
    data = [bus.to_json() for bus in qs]

    resp = make_response(json.dumps(data))
    resp.cache_control.no_cache = True
    resp.headers['Content-Type'] = 'application/json'

    return resp
dataset/ETHPy150Open shaunduncan/breezeminder/breezeminder/views/marta.py/route_realtime/swapped operands of `-`