[Zope-CMF] validateMetadata
Dieter Maurer
dieter@handshake.de
Thu, 3 Jan 2002 20:52:33 +0100
Tres Seaver writes:
> > Is there for that situation a way to rollback the editMetadata
> > call? I'm not a undo / rollback-expert :-) so sorry for asking
> > the obvious.
>
> Because writes to the ZODB are transactional, it is perfectly
> fine to first write the attributes and then test them: if
> 'validateMetadata' raises an exception, the writes will be
> rolled back.
In my view, this is not completely satisfactory, because I usually
do not want to raise an exception. Instead, I would like to
redisplay the form with error information.
I know, I can use 'raise type="redirect"' for this, but it is
quite clumsy to pass the error information through the "redirect".
Dieter