示例#1
0
 def transform_into_absolute_url(config, url):
     if url.startswith(config.uri):
         return url
     url = url.lstrip('/')
     if url.startswith(config.version):
         url = urljoin(config.root_uri, url)
     else:
         url = urljoin(config.uri, url)
     return url
 def transform_into_absolute_url(config, url):
     if url.startswith(config.uri):
         return url
     url = url.lstrip('/')
     if url.startswith(config.version):
         url = urljoin(config.root_uri, url)
     else:
         url = urljoin(config.uri, url)
     return url
示例#3
0
 def prepend_version(config, url):
     url = url.lstrip('/')
     if not url.startswith(config.version):
         url = urljoin(config.version, url)
     return url
示例#4
0
 def uri(self):
     return urljoin(self.root_uri, self.version)
 def prepend_version(config, url):
     url = url.lstrip('/')
     if not url.startswith(config.version):
         url = urljoin(config.version, url)
     return url