Ejemplo n.º 1
0
def lookup_redirect(url):
    """Looks up a redirect.  If there is not redirect for the given URL,
    the return value is `None`.
    """
    row = db.execute(
        redirects.select(redirects.c.original == _strip_url(url))).fetchone()
    if row:
        return make_external_url(row.new)
Ejemplo n.º 2
0
def lookup_redirect(url):
    """Looks up a redirect.  If there is not redirect for the given URL,
    the return value is `None`.
    """
    row = db.execute(redirects.select(
        redirects.c.original == _strip_url(url)
    )).fetchone()
    if row:
        return make_external_url(row.new)
Ejemplo n.º 3
0
 def comment_feed_url(self):
     """The link to the comment feed."""
     return make_external_url(self.slug.rstrip('/') + '/feed.atom')
Ejemplo n.º 4
0
 def comment_feed_url(self):
     """The link to the comment feed."""
     return make_external_url(self.slug.rstrip('/') + '/feed.atom')
Ejemplo n.º 5
0
def get_redirect_map():
    """Return a dict of all redirects."""
    return dict((row.original, make_external_url(row.new))
                for row in db.execute(redirects.select()))
Ejemplo n.º 6
0
def get_redirect_map():
    """Return a dict of all redirects."""
    return dict((row.original, make_external_url(row.new)) for row in
                db.execute(redirects.select()))