[z3-five] formlib acquisition error

Maciej Wisniowski maciej.wisniowski at coig.katowice.pl
Tue Feb 6 07:31:39 CET 2007


> I'm using Five 1.4.1 with Zope 2.9.6 and using the (base-) classes
>
>    Products.Five.formlib.formbase.PageForm
>    Products.Five.browser.pagetemplatefile.ViewPageTemplateFile
>
> I'm trying to call self.template() in an action handler, but that fails
> because self (the form) is not acquistion-wrapped (at all) in the body
> of the action handler, thus
>
>       @form.action("foo")
>       def action_foo(self, action, data):
>           return self.template()
>
> is bound to fail.
>   
You have import of ViewPageTemplateFile. Do you
use this to create self.template object?
If so then maybe try with

from Products.Five.browser.pagetemplatefile import \
     ZopeTwoPageTemplateFile

Take a look at Chris Withers' thread about "(re)using zpt 
macros from view page templates" from 2007-01-28.
Maybe this will help somehow.

-- 
Maciej Wisniowski



More information about the z3-five mailing list