[Zope] How to make a ZPT-based form that calls itself?

Phillip Hutchings sitharus at gmail.com
Wed May 11 17:29:00 EDT 2005


> > Case A:
> >    return context.some_page()
> >
> > Case B:
> >    context.REQUEST.RESPONSE.redirect('some_page')
> >
> GREAT!!  Case B works perfectly (and it would have taken me forever to guess
> this solution).  Case A didn't work when written as
> 
> return context.deltest.htm()

Of course it didn't, there's no object called deltest and the object
that's not there certainly doesn't have a method called htm. Think
about Python syntax - the . delimits a class containment hierarchy.
Zope allows you to have the . in object names, which I disagree with,
so you have to use getattr(context, 'deltext.htm')() to get the actual
object.

-- 
Phillip Hutchings
http://www.sitharus.com/
sitharus at gmail.com / sitharus at sitharus.com


More information about the Zope mailing list