[Zope] UnpickleableError

Arne Krug arne.krug@adviion.de
Wed, 19 Jun 2002 16:28:05 +0200


Hello,
I try to write a Zope-Product and I always get following Error:

Error Type: UnpickleableError
Error Value: Cannot pickle objects

The problem is the following line in the __init__ method of the class:
self.menuHeader = HTML('<table>',globals())
I thought it should be possible as the class HTML inherits from Persistent
or is it impossible to include objects in the first place.
Thanks for any help!

arne


#########################################
from OFS.SimpleItem import SimpleItem

import Persistence

from Globals import HTML

class AmazingMenu(SimpleItem,Persistence.Persistent):
	title = "Amazing Menu Tree"
	meta_type = 'Amazing Menu'

	manage_options = (
			{ 'label':'Tree','action':'manageTree' },
			{ 'label':'Header','action':'manageTemplates' },
			{ 'label':'Settings','action':'manageSettings' },
			{ 'label':'Consistency Check','action':'consistencycheck' },
		)

	def __init__(self,id):
		self.id = id

		self.menuHeader = HTML('<table>',globals())

		self.link_target = ''

		return
.
.
.
.

def manageAddAmazingMenuForm(self,REQUEST):

	o = AmazingMenu('amazing_menu')

	self._setObject('amazing_menu',o)

	return "abcd"
#####################################