[Zope] Acquisition not working as expected

Andrew Milton akm at theinternet.com.au
Wed Mar 1 07:34:40 EST 2006


+-------[ Roman Klesel ]----------------------
| Hello,

| class ZLTMS(Lasttest,Implicit, Persistent, PropertyManager, ObjectManager, SimpleItem):
| 	"""ZLMTS object"""
| 
| ... has an import method
| 
| 	def newLasttest(self, REQUEST=None):
| 		""" new """
| 		ltc=getattr(self,'LoadTests')
| 		ltid = self.genId(ltc)
| 		lt=Lasttest()
| 		lt.id=ltid
| 		ltc._setObject(ltid,lt)
| 		self.lt = getattr(ltc,ltid)
| 		self.lt.importData(self.manage_targets)
| 
| 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.
| 
| eg.:
| 
| In the base class I created a test3() method:
| 
| 	def test3(self):
| 		"""dsaf"""
| 		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?

Are you sure your genId() method works?

what does return self.id return instead of self.getId() ?

-- 
Andrew Milton
akm at theinternet.com.au


More information about the Zope mailing list