[Zope-CMF] __bobo_traverse__ problem
kapil thangavelu
kthangavelu@earthlink.net
Tue, 13 Aug 2002 18:04:26 -0700
On Tuesday 13 August 2002 08:36 am, Geoff Davis wrote:
> Hi all--
>
> I am building a portal tool to take care of some of the navigation and
> validation involved in working with forms in plone. The goal is to create
> a portal tool called portal_form that wraps a form in a URL like so:
>
> http://myCMFSite/myObject/portal_form/myObjectEdit
>
> where myObjectEdit is a page template with a form for editing myObject.
> The main functionality of portal_form is embedded in its bobo_traverse
> method, which intercepts page loads and calls validation scripts as
> necessary, etc. I'm having what appear to be some acquisition-related
> problems with my current setup and am wondering if anyone can help shed
> some light on what's going on:
>
> Here's a simplified version of what I'm building:
>
> class FormTool(UniqueObject, SimpleItem):
>
> id = 'portal_form'
> meta_type= 'Plone Form Tool'
> security = ClassSecurityInfo()
> security.declarePublic('__bobo_traverse__')
>
> # An implementation of __bobo_traverse__ that does nothing interesting
> def __bobo_traverse__(self, REQUEST, name):
> """ """
> return getattr(self, name)
i told this to geoff over irc, which solved his problem. i think its germane
to that problem only, but in case anyone was curious the solution was
return getattr(aq_parent(self), name)
-k