This decorator raises a ConstraintError (or subclass) on any
        call to the given method.

def block(cls, method):
        """
        This decorator raises a ConstraintError (or subclass) on any
        call to the given method.
        """
        def blocked_method(self, *a, **kw):
            raise cls(self, method.__name__, a, kw)
        return blocked_method