[Zope-dev] Re: DTML ZClass ID Bug
Alexandre Ratti
ratti@dial.oleane.com
Thu, 21 Oct 1999 12:29:01 +0200
Hello,
Thanks for your input Jason.
I created a new CatalogAware ZClass without subclassing DTMLMethod and
Document. The new ZClass instances work fine and they have an ID that can
be retrieve from DTML.
The only thing that puzzles me is that they cannot be cut and pasted
around. They can be duplicated but not moved with cut and paste. It
triggers an AttributeError (copied below) in the CatalogAware object.
Did anyone solve this issue?
Cheers.
Alexandre
--- Error message --
Error Type: AttributeError
Error Value: REQUEST
Traceback (innermost last):
File D:\ZOPE\GISTI\lib\python\ZPublisher\Publish.py, line 214, in
publish_module
File D:\ZOPE\GISTI\lib\python\ZPublisher\Publish.py, line 179, in publish
File D:\ZOPE\GISTI\lib\python\Zope\__init__.py, line 201, in
zpublisher_exception_hook
(Object: ElementWithAttributes)
File D:\ZOPE\GISTI\lib\python\ZPublisher\Publish.py, line 165, in publish
File D:\ZOPE\GISTI\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: manage_pasteObjects)
File D:\ZOPE\GISTI\lib\python\ZPublisher\Publish.py, line 102, in
call_object
(Object: manage_pasteObjects)
File D:\ZOPE\GISTI\lib\python\OFS\CopySupport.py, line 225, in
manage_pasteObjects
(Object: ElementWithAttributes)
File D:\ZOPE\GISTI\lib\python\OFS\ObjectManager.py, line 264, in _delObject
(Object: ElementWithAttributes)
File D:\Zope\Gisti\lib\python\Products\ZCatalog\CatalogAwareness.py,
line 130, in manage_beforeDelete
(Object: CatalogAware)
File D:\Zope\Gisti\lib\python\Products\ZCatalog\CatalogAwareness.py,
line 187, in unindex_object
(Object: CatalogAware)
File D:\Zope\Gisti\lib\python\Products\ZCatalog\CatalogAwareness.py,
line 157, in url
(Object: CatalogAware)
File D:\ZOPE\GISTI\lib\python\OFS\SimpleItem.py, line 316, in absolute_url
(Object: CatalogAware)
AttributeError: (see above)
----
At 17:52 20/10/1999 -0400, Jason Spisak wrote:
>I had submitted this to Collector about a month ago, and have since
>wrote an external method to get around creating them with id's.
>
>If you create a ZClass instance based on DTMLMethod or Document through
>the web interface you end up with an object that has no id. (Or at least
>no way to see it outside the management screens)
>
>If you create the same object in python using:
>
>from DateTime import DateTime
>from OFS import DTMLMethod
>
>def make_resume(rfile,id,title)
> ob=ob.__of__(self)
> if rfile:
> my_ob=self.Control_Panel.Products.MyClass()
> my_ob.id=id
> my_ob.propertysheets.MyProperties.manage_changeProperties(
> myproperty=rfile.read())
> my_ob.manage_edit("""<!--#var standard_html_header--><!--#var
>myproperty--><!--#var
> standard_html_footer-->""",title)
> my_ob=my_ob.__of__(ob)
> ob._setObject(id, my_ob)
>
>
>You get an id just fine. It acts like any other web created ZClass
>instance.
>
>I hope DC fixes this soon. It's really hampering not being able to
>extend DTMLDocuemnts and DTML Methods as Zclasses.
>
>All my best,
>
>--
>Jason Spisak
>webmaster@hiretechs.com
(snip)