def relative_url(self): """ Returns the relative URL, basically minus the domain. Returns ------- str Realtive URL to file """ parts = [current_app.config['STORE_URL_PREFIX'], ] if self.location: parts.append(self.location) parts.append(self.filename) return path_to_uri(self.url_join(*parts))
def absolute_url(self): """ Absolute url contains a domain if it is set in the configuration, the url predix, location and the actual file name. Returns ------- str Full absolute URL to file """ if not current_app.config['STORE_DOMAIN']: path = self.relative_url path = urljoin(current_app.config['STORE_DOMAIN'], self.relative_url) return path_to_uri(path)
def relative_url(self): """ Returns the relative URL, basically minus the domain. Returns ------- str Realtive URL to file """ parts = [ current_app.config['STORE_URL_PREFIX'], ] if self.location: parts.append(self.location) parts.append(self.filename) return path_to_uri(self.url_join(*parts))
def absolute_url(self): """ Absolute url contains a domain if it is set in the configuration, the url predix, location and the actual file name. Returns ------- str Full absolute URL to file """ if not current_app.config['STORE_DOMAIN']: path = self.relative_url path = urlparse.urljoin( current_app.config['STORE_DOMAIN'], self.relative_url) return path_to_uri(path)