def get_url(self, res):
        if isinstance(res, str):
            return res
        if hasattr(res, 'url'):
            return str(res.url)