sorry to come up with this again. I startet 2 pretty confused threads on the 
same problem allready:

[Zope] Error Value: 'File'      object  has     no      attribute       
Re: [Zope] context in fs product

Unfortunatly I'm still not getting it right.
I implemeted the good advices I got in the 2 Threads, slept over it a couple of 
nights. Looked at the code again,
cleaned it up ... still: no success.

Here is what I'm doing:

I'm about to write a fs product to report on data generated by the "grinder 
load test tool"
The load tests produce various log files and sar outputs that will have to be 
parsed and imported into Zope.

The instance of the product is created:

def manage_addZLTMS(self,id,title='',REQUEST=None,submit=None):
        "Add a ZLMTS to a folder."
        id=id.replace(' ','_')
        id=self._setObject(id, zltmsObj)
        folder=getattr(self, id)

The LoadTest folder is the place where the imported data will be stored.

The base class ...

class ZLTMS(Lasttest,Implicit, Persistent, PropertyManager, ObjectManager, 
        """ZLMTS object"""

... has an import method

        def newLasttest(self, REQUEST=None):
                """ new """
                ltid = self.genId(ltc)
                self.lt = getattr(ltc,ltid)

This generates and instance of the Lasttest() class and imports the data.
Lasttest() subclasses from Folder() and store all imported data in a folder 
hirarchy under itself.

This all works fine and I can browse the imported data in the ZMI. The problems 
start when I want to access the data.


In the base class I created a test3() method:

        def test3(self):
                return self.getId()

I can call this method on whatever folder inside the product instance I want, 
it will always return the id of the
product and not the id of the product I call it on.

Why is that?

So I thought for some reasons the objects in the folder hirarchy are not 
acquisition wrapped. So I created another
testspace() method in the base class:

        def testspace(self,REQUEST=None):
                if hasattr(self, 'aq_base'):
                        return 'aq wraped'
                return 'not aq wraped'

I can call this on any object in the folder hirarchy and it returns:
'aq wrapped'.

Can so. please help me get this straight or hint towards further analysis that 
I can do.

Thanks in advance.

Greetings Roman

BTW: I did not post any code of the Lattest() class since the problem is 
allready present in the folder that holds its
instances. Of course I will post any part of the code you want me to.
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to