[Zope] UnpickleableError
Arne Krug
akrug@mps.de
Sun, 23 Jun 2002 18:33:12 +0200
Thanks,
it works with DTMLFile or HTMLFile.
But I still have a general question about the Globals.HTML class.
I tried to include a HTML object in the Boring Product:
__init__....
self.test = HTML('<table>', globals())
for example and it did not work either. The same "UnpickleableError"
occurred.
What is wrong with including a HTML object in the product. Isn't it
more or less just a string....
Arne
> Arne Krug writes:
> > 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.
> No, you can include objects, even non-persistent ones.
>
> They need only be picklable.
>
> I do not see what is the cause of your problem, though.
>
> I would try:
>
> from Globals import DTMLFile
>
> class AmazingMenu(....)
> menuHeader= DTMLFile('the file name',globals())
> ...
> def __init__(...):
>
>
> Dieter
--- Arne Krug: ---
--- ufcx@rz.uni-karlsruhe.de ---
--- akrug@mps.de ---