Hello,

Roman Klesel schrieb:
 > 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.

In order to make my problem more obvious I created a minimal product. See 
attachmet.

It displays exactly the problem I'm facing:

A method in the base class that returns self.id, returns the id of the base 
class on all subfolders it is called.

Code:

 __doc__="""This is Minimal"""
__version__='0.1'

from Globals import InitializeClass, Persistent
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from AccessControl import ClassSecurityInfo
from Acquisition import Implicit
from OFS.ObjectManager import ObjectManager
from OFS.SimpleItem import SimpleItem
import OFS


class minimal(Persistent,Implicit,ObjectManager,SimpleItem):
        "minimal object"
        security = ClassSecurityInfo()
        meta_type = 'minimal'
        
        def __init__(self, id):
                "initialise a new instance of Minimal"
                self.id = id

        index_html=PageTemplateFile('zpt/index.html',globals())

        security.declarePublic('sayHello')
        def sayHello(self):
                """just says hello"""
                return 'Hello'
        def showId(self):
                return self.id
        
def manage_addMinimal(self, REQUEST=None):
        "Add a Minimal to a folder."
        self._setObject('minimal_id', minimal('minimal_id'))
        min_obj = getattr(self,'minimal_id')
        min_obj.manage_addFolder('tfolder')
        if REQUEST is not None:
                try:
                        destURL=self.DestinationURL()
                except:
                        destURL=REQUEST['URL1']

        REQUEST.RESPONSE.redirect(destURL+'/manage_main')                       
        return ''       

InitializeClass(minimal)


Any ideas anyone?

Greetings Roman

Attachment: minimal.tar.gz
Description: GNU Zip compressed data

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to