[ZPatterns] _v_dm_ KeyError calling get_transaction().abort()
Steve Alexander
[email protected]
Mon, 08 Oct 2001 08:37:12 +0100
Itai Tavor wrote:
> Hi Steve,
>
> Thanks! Wild guess it may be, but it seems to be accurate. I changed the
> code to:
>
> method = getattr(self, 'edit.html')
> get_transaction().abort()
> html = method(self, REQUEST, errors=errors)
> raise FormError, html
>
> Now the getattr() works, but the html = method() call doesn't, for the
> same reason, except that I now get a TAL error:
>
> Error Type: Undefined
> Error Value: "_v_dm_" not found in "here/master.html/macros/master"
>
> So I'm still stuck. I need to roll back the transaction before I render
> the html method (or in this case, PT), because otherwise the method
> shows false attributes...
>
> Any ideas how to get around this?
Try using a subtransaction, and aborting the subtransaction.
I don't understand why you're aborting a transaction, then raising an
error. Zope aborts the transaction for you when you raise an error.
--
Steve Alexander
Software Engineer
Cat-Box limited