def action(*args, **kwargs):
    """Transforms functions or class methods into actions.
    Optionnaly, you can define a function to be used as the view initializer:

        @action()
        def my_action():
            pass

        @my_action.init_view
        def my_action_init_view(view, options):
            pass
    """
    def decorator(f):
        return ActionFunction(f, *args, **kwargs)
    return decorator
Transforms functions or class methods into actions.
    Optionnaly, you can define a function to be used as the view initializer:

        @action()
        def my_action():
            pass

        @my_action.init_view
        def my_action_init_view(view, options):
            pass