Exemplo n.º 1
0
    def site_url(self, path=""):
        if settings.URL_CONFIG == "path":
            return self._site_path_url(path)

        return logic.build_url(
            netloc=self.domain,
            scheme=self.SCHEMES[self.is_secure],
            port=None,
            path=path,
        )
Exemplo n.º 2
0
    def journal_path_url(self, journal, path=None):
        """ Returns a Journal's path mode url relative to its press """

        _path = journal.code
        request = logic.get_current_request()
        if settings.DEBUG and request:
            port = request.get_port()
        else:
            port = None
        if path is not None:
            _path += path

        return logic.build_url(
            netloc=self.domain,
            scheme=self.SCHEMES[self.is_secure],
            port=port,
            path=_path,
        )
Exemplo n.º 3
0
 def site_url(self, path=None):
     return logic.build_url(
         netloc=self.domain,
         scheme=self.SCHEMES[self.is_secure],
         path=path or "",
     )