def get_image(self, gateway): """Return an image for the given gateway. The API by default looks for the `get_image` method in the model of the given gateway. If there is such a method, the value returned from calling that method with the browse record of the method as argument is taken. """ gateway_model_obj = Pool().get(gateway.model.model) if hasattr(gateway_model_obj, 'get_image'): return gateway_model_obj.get_image(gateway) return None