[Zope] revised ZClass question
Sam Gendler
sgendler@teknolojix.com
Tue, 30 Nov 1999 13:03:35 -0800
I have a product built with a ZClass. In the Product (called
MethodClass), I have an external method that contains an instance of an
HTMLParser from htmllib. That external method is called from the
MethodClass_add function (the constructor). I also want to call this
external method from a method within the ZClass. When I call it with
dtml-call, I get a NameError, which implies that the external method is
not acquired, I have no idea how acquisition works within a ZClass
product, however. Then I tried creating an external method inside the
ZClass that calls the same function, and I get an ugly error that does
not happen when the method is called from the Product constructor:
Error Type: TypeError
Error Value: __add__ nor __radd__ defined for these operands
Traceback (innermost last):
File /home/sgendler/Zope-2.0.1-src/lib/python/ZPublisher/Publish.py,
line 214, in publish_module
File /home/sgendler/Zope-2.0.1-src/lib/python/ZPublisher/Publish.py,
line 179, in publish
File /home/sgendler/Zope-2.0.1-src/lib/python/Zope/__init__.py, line
201, in zpublisher_exception_hook
(Object: <string>)
File /home/sgendler/Zope-2.0.1-src/lib/python/ZPublisher/Publish.py,
line 165, in publish
File /home/sgendler/Zope-2.0.1-src/lib/python/ZPublisher/mapply.py,
line 160, in mapply
(Object: manage_stripUpload)
File /home/sgendler/Zope-2.0.1-src/lib/python/ZPublisher/Publish.py,
line 102, in call_object
(Object: manage_stripUpload)
File /home/sgendler/Zope-2.0.1-src/lib/python/OFS/DTMLMethod.py, line
145, in __call__
(Object: manage_stripUpload)
File
/home/sgendler/Zope-2.0.1-src/lib/python/DocumentTemplate/DT_String.py,
line 502, in __call__
(Object: manage_stripUpload)
File
/home/sgendler/Zope-2.0.1-src/lib/python/DocumentTemplate/DT_Util.py,
line 321, in eval
(Object: strip_extra_html(REQUEST['file'], REQUEST))
File <string>, line 0, in ?
File
/home/sgendler/Zope-2.0.1-src/lib/python/Products/ExternalMethod/ExternalMethod.py,
line 246, in __call__
(Object: strip_extra_html)
(Info: ((<ZPublisher.HTTPRequest.FileUpload instance at
85e6668>,<loads of stuff from the REQUEST structure was here, snipped>,
{}, None))
File /home/sgendler/Zope-2.0.1-src/Extensions/test.py, line 19, in
StripFile
File /var/tmp/python-root/usr/lib/python1.5/sgmllib.py, line 82, in
feed
TypeError: (see above)