def conditional(condition, decorator):
    """ Decorator for a conditionally applied decorator.

        Example:

           @conditional(get_config('use_cache'), ormcache)
           def fn():
               pass
    """
    if condition:
        return decorator
    else:
        return lambda fn: fn