Codebase list django-stronghold / debian/0.3.0+debian-1 stronghold / utils.py
debian/0.3.0+debian-1

Tree @debian/0.3.0+debian-1 (Download .tar.gz)

utils.py @debian/0.3.0+debian-1raw · history · blame

def is_view_func_public(func):
    """
    Returns whether a view is public or not (ie/ has the STRONGHOLD_IS_PUBLIC
    attribute set)
    """
    return getattr(func, 'STRONGHOLD_IS_PUBLIC', False)


def set_view_func_public(func):
    """
    Set the STRONGHOLD_IS_PUBLIC attribute on a given function to True
    """
    setattr(func, 'STRONGHOLD_IS_PUBLIC', True)