def get_view_builder(req): ''' A factory method that returns the correct builder based on the version of the api requested. ''' version = common.get_api_version(req) if version == '1.1': return ViewBuilder_1_1() else: return ViewBuilder_1_0()
def get_view_builder(req): ''' A factory method that returns the correct builder based on the version of the api requested. ''' version = common.get_api_version(req) addresses_builder = addresses_view.get_view_builder(req) if version == '1.1': flavor_builder = flavors_view.get_view_builder(req) image_builder = images_view.get_view_builder(req) return ViewBuilder_1_1(addresses_builder, flavor_builder, image_builder) else: return ViewBuilder_1_0(addresses_builder)