models.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:django-powerpages 作者: Open-E-WEB 项目源码 文件源码
def url_by_alias(page_alias):
        """
        Try to read page url from cache. If it's missing then try to find
        matching page that could be missing in cache. If page is found
        then refresh all url list since it's too old.
        If no matching is found then return None so we can throw any
        exception we want in other places
        """
        if page_alias:
            url_to_alias = cache.get(cachekeys.URL_LIST_CACHE)
            if url_to_alias is None:
                url_to_alias = PageURLCache.refresh()
            url = url_to_alias.get(page_alias)
        else:
            url = None
        return url


# Models:
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号