def get_all_routes(): routes = nextbus.get_all_routes_for_agency('sf-muni') list = [] for route in routes: route_dict = {} route_dict['tag'], route_dict['title'] = route.tag, route.title list.append(route_dict) return list
def handle_route_list(agency_id): nextbus_routes = nextbus.get_all_routes_for_agency(agency_id) routes = map(lambda nb_r: model.RouteRef.from_nextbus(nb_r), nextbus_routes) return model.List(ObjectField(model.RouteRef))(routes)