条件が満たされた場合に another_decorator を適用し、それ以外の場合は単に関数 を適用するデコレータを定義したいと思います。
以下は動作しません..
def decorator_for_post(view_func):
@functools.wraps(view_func)
def wrapper(request, *args, **kwargs):
if request.method == 'POST':
return another_decorator(view_func) # we apply **another_decorator**
return view_func # we just use the view_func
return wrapper