コード例 #1
0
def author_cache_key(m, i, author):
    """Cache key that discriminates on the user ID of the provided user
    (Plone user or string), and the hostname.

    The hostname is required because this cache key is used to cache generated
    URLs, which are dependent on the hostname that is used to access the
    system (might be localhost + SSH tunnel).
    """
    hostname = get_hostname(getRequest())
    if IPropertiedUser.providedBy(author) or IMemberData.providedBy(author):
        userid = author.getId()
    else:
        userid = author
    return (userid, hostname)
コード例 #2
0
def author_cache_key(m, i, author):
    """Cache key that discriminates on the user ID of the provided user
    (Plone user or string), and the hostname.

    The hostname is required because this cache key is used to cache generated
    URLs, which are dependent on the hostname that is used to access the
    system (might be localhost + SSH tunnel).
    """
    hostname = get_hostname(getRequest())
    if IPropertiedUser.providedBy(author) or IMemberData.providedBy(author):
        userid = author.getId()
    else:
        userid = author
    return (userid, hostname)
コード例 #3
0
ファイル: utils.py プロジェクト: robertmuehsig/opengever.core
def hostname_cache_key(m, *args, **kwargs):
    return get_hostname(getRequest())
コード例 #4
0
ファイル: utils.py プロジェクト: lukasgraf/opengever.core
def hostname_cache_key(m):
    return get_hostname(getRequest())