[Zope-dev] Python Product as DataSkin

Michael R. Bernstein webmaven@lvcm.com
Tue, 20 Feb 2001 20:20:33 -0800


Ok, to recap:

1) Add 'import Globals' to the start of the myClass.py file

2) Change the def __init__ in the 'class myClass' definition
to:

   def __init__(self, id, title):
       myClass.inheritedAttribute('__init__')(self, id)
       # rest of your __init__ method

3) add the following line at the end of the file (with no
indenting):

   Globals.default__class_init__(myClass)

Is this supposed to work and let me instantiate a DataSkin
derived class through the 'normal' mgmt interface? if so,
something is wrong, because I'm still getting the same
error:

--8<--------------------------------------
This resource may be trying to reference a
nonexistent object or variable _v_dm_

The URL may be incorrect.
The parameters passed to this resource may be incorrect.
A resource that this resource relies on may be encountering
an error.

Traceback (innermost last):
  File
/usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py,
line 222, in publish_module
  File
/usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py,
line 187, in publish
  File
/usr/local/Zope-2.2.0-src/lib/python/Zope/__init__.py, line
221, in zpublisher_exception_hook
  File
/usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py,
line 171, in publish
  File
/usr/local/Zope-2.2.0-src/lib/python/ZPublisher/mapply.py,
line 160, in mapply
    (Object: manage_addArchiveImage)
  File
/usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py,
line 112, in call_object
    (Object: manage_addArchiveImage)
  File /home/webmaven/Products/ArchiveImage/ArchiveImage.py,
line 46, in manage_addArchiveImage
    (Object: ApplicationDefaultPermissions)
  File /home/webmaven/Products/ArchiveImage/ArchiveImage.py,
line 80, in __init__
    (Object: ElementWithAttributes)
  File /home/webmaven/Products/ZPatterns/DataSkins.py, line
208, in __set_attr__
    (Object: ElementWithAttributes)
KeyError: (see above)
--8<--------------------------------------

For your reference, line 80 in ArchiveImage.py is the first
line in the '__init__' function after the
'ArchiveImage.inheritedAttribute('__init__')(self, id)'
line, and reads:

  self.__name__=id

I don't know what to try next. Any suggestions? If I zip up
the whole Product, could you (or anyone else on the list)
take a look at it? I have a feeling I'm missing something
obvious.

Thanks,

Michael Bernstein.