[Zope-dev] Replacing a manage_ methods with a callable object

Johan Carlsson johanc@torped.se
Sat, 19 Aug 2000 16:38:42 +0200


Hi,
I'm trying to replace a manage_x method with a
object instanciated (x) in the class fo the object being
managed.

That seems to work alright but the management tabs get
when x is called.

What I realy want is a way to get the REQUEST as if the last
traversal was never occured. (unfortunatly it's not in my reach
because it's done in the parent of the "my_published_object" object).
It needs to be reverted one step maybe before calling 
self.aq_parent.manage_tabs (basicly its the only place I need it 
att this point).

Also are there any potential pitfall's in doing that I'm doing?

Best Regards,
Johan Carlsson

class my_manage_class(...):
    """doc sting"""
    _isBeingUsedAsAMethod_=1   # this doesn't work the way I hope it would :-(
    _isBeingUsedAsAMethod         # what's the differense between the two?

    index_html = HTMLFile(some default DTML calling manage_tabs)

    def manage_tabs(self):
        # doesn't realy change the REQUEST context, coold that be done?
        return self.aq_parent.manage_tabs(self.aq_parent,self.REQUEST)  


class my_published_object(...):
    """doc sting"""
    manage_main = my_manage_class()

    manage_options=(this is the options i also want to use in manage_main)