[Zope-dev] Explicit acquisition and object context

Garito garito at sistes.net
Thu Feb 26 11:49:26 EST 2004


Hi
I have these function

def Propiedad(self, Name):
        """Propiedad"""
        Obj = self
        Maestro = getattr(Obj, 'Maestro', None)
        Paso = 1
        while Maestro is not None:
            Obj = self.restrictedTraverse(Maestro.contenido).__of__(self)
            Maestro = getattr(Obj, 'Maestro', None)
            Paso += 1
            if Paso == 15: break
        if hasattr(Obj, Name):
            return getattr(Obj, Name)
        return getattr(self, Name)

these code try to get the object Maestro, and recursively search the for Maestro's until is not found
Width these code I try to use an object called Maestro to make soft links

My problem is to acquire the real context of self

If I add in my product these function:

def __bobo_traverse__(self, Request, Name):
        return self.Propiedad(Name) 

ZMI show me the soft link object and not the real self

Has anyone idea to help me, please?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-dev/attachments/20040226/195d027d/attachment.html


More information about the Zope-Dev mailing list