[Zope-dev] Simple ZClass Stuff

2001-05-26 Thread Eric Roby

I have been on this Zope journey since late February.  Most times Zope has
been like an artichoke, thorny on the outside but improves dramatically as
you peel off the layers and can get to the meat.  Other times (very few to
date) Zope is like an onion,  the more layers you peel off the more tears
you have to deal with.  Well this is one of those onion-times.

I have been exploring the processes involved in creating Zope products via
ZClasses.  I have read all the primers/How-To's, latest version of the Zope
Book.  I have been successful in creating a
Renderable:Renderable-ZCatalog:CatalogAware structured-text document class.
However, I am unable to create a simple
ZCatalog:CatalogAware-OFS:DTMLDocument class.  I have tried many different
incantations, sacrificed my first born but to no avail.  I have even tried
to just select OFS:DTMLDocument as my subclass.  Regardless how I slice it,
I consistently get:

Error Type: TypeError
Error Value: unsliceable object

The Traceback is as follows:***Sorry, these guys still
evade my comprehension***
Traceback (innermost last):
  File F:\WebSite\lib\python\ZPublisher\Publish.py, line 223, in
publish_module
  File F:\WebSite\lib\python\ZPublisher\Publish.py, line 187, in publish
  File F:\WebSite\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
(Object: RoleManager)
  File F:\WebSite\lib\python\ZPublisher\Publish.py, line 171, in publish
  File F:\WebSite\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: htmlDocumentClass_add)
  File F:\WebSite\lib\python\ZPublisher\Publish.py, line 112, in call_object
(Object: htmlDocumentClass_add)
  File F:\WebSite\lib\python\OFS\DTMLMethod.py, line 189, in __call__
(Object: htmlDocumentClass_add)
  File F:\WebSite\lib\python\DocumentTemplate\DT_String.py, line 549, in
__call__
(Object: htmlDocumentClass_add)
  File F:\WebSite\lib\python\DocumentTemplate\DT_With.py, line 133, in
render
(Object: htmlDocumentClass.createInObjectManager(REQUEST['id'],
REQUEST))
  File F:\WebSite\lib\python\DocumentTemplate\DT_Util.py, line 334, in eval
(Object: htmlDocumentClass.createInObjectManager(REQUEST['id'],
REQUEST))
(Info: REQUEST)
  File , line 0, in ?
  File F:\WebSite\lib\python\ZClasses\ZClass.py, line 543, in
createInObjectManager
(Object: htmlDocumentClass)
  File F:\WebSite\lib\python\OFS\ObjectManager.py, line 265, in _getOb
(Object: Traversable)
TypeError: (see above)

NOTE:
On one attempt, I modified the constructor input form to use
'addDTMLDocument' and the class method to use 'manage_edit' and
'manage_upload'.  These changes got past the 'unsliceable object' error,
however, when instantiating this class, I was unable to access the property
sheets and views that I had defined.  I was left with the default views
defined for the DTML Document class.

The Zope Book says I can create a new class using OFS:DTMLDocument as my
base class, generate my property sheets, hook my property sheets to views
and be on my way.

If anyone can enlighten me here I would be much in you debt.  Obviously, I
am missing a key point.

Eric

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Simple ZClass Stuff

2001-05-27 Thread Joachim Werner

> Error Type: TypeError
> Error Value: unsliceable object

Have you tried to use the newest Zope version? In 2.3.0 or so there was a
bug that gave us the "unsliceable object" error for ZClasses that are based
on "Image" or "File" (which should be similar to the DTMLDocument case).
Newer versions work fine again.

> NOTE:
> On one attempt, I modified the constructor input form to use
> 'addDTMLDocument' and the class method to use 'manage_edit' and
> 'manage_upload'.  These changes got past the 'unsliceable object' error,
> however, when instantiating this class, I was unable to access the
property
> sheets and views that I had defined.  I was left with the default views
> defined for the DTML Document class.

I guess with this you actually create plain DTMLDocuments, not the new
ZClass you have defined. This is why you don't get any of your customized
propertysheets.

BTW: What do you need a "DTMLDocument" ZClass for? I would not really know
what it could be good for ...

Joachim



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )