[Zope] What kind of attributes can be put inside a simple item

Marco Bizzarri m.bizzarri at icube.it
Fri Feb 18 04:36:47 EST 2005


Hi all.

I'm little surprised by the possibility to insert non-persistent 
instances inside persistent object. I mean:

class Alfa:
	def __init__(self):
		self.x = 1
		self.y = 2


class Beta(SimpleItem):
	def __init__(self):
		self.id = 'anId'
		self.anAlfa = Alfa()


I always understood that I could not put Alfa instances inside a Beta 
class, because the ZODB machinery did not understood how to pickle them. 
But I did some experiments recently, and it looks like the above example 
should work.

Could anyone provide some insight on this topic?

Thanks

Regards
Marco


More information about the Zope mailing list