def get_nearby_courts(court_name): if 'nearbyCourts' not in courts_by_name[court_name]: print 'LOOKING UP COURTS NEAR', court_name nearby_courts = Database.find_courts('circuit', court_name, 40) courts_by_name[court_name]['nearbyCourts'] = \ [court['fips_code'] for court in nearby_courts] return courts_by_name[court_name]['nearbyCourts']
def court_list(court_type, court_name, miles): courts = list(Database.find_courts(court_type, court_name, int(miles))) return jsonify(courts=courts)