[Zope] LockableItem

belen@netcom.no belen@netcom.no
Fri, 26 Oct 2001 17:14:11 +0100


This is a multi-part message in MIME format.

----7e5155d67b52694
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Hello,

I have a very weird problem. I am appending to a list a piece of data 
that I have retrieved from a ZSQLMethod within an external method. That 
piece of data happens to be type date. This is with Zope 2.4.

Error Type: TypeError
Error Value: __init__() takes at least 3 arguments (2 given)

Traceback (innermost last):
  File C:\Zope\BELENS~1\lib\python\ZPublisher\Publish.py, line 223, in 
publish_module
  File C:\Zope\BELENS~1\lib\python\ZPublisher\Publish.py, line 187, in 
publish
  File C:\Zope\BELENS~1\lib\python\Zope\__init__.py, line 226, in 
zpublisher_exception_hook
    (Object: LockableItem)
  File C:\Zope\BELENS~1\lib\python\ZPublisher\Publish.py, line 171, in 
publish
  File C:\Zope\BELENS~1\lib\python\ZPublisher\mapply.py, line 160, in 
mapply
    (Object: DataForPie)
  File C:\Zope\BELENS~1\lib\python\ZPublisher\Publish.py, line 112, in 
call_object
    (Object: DataForPie)
  File C:\Zope\BELENS~1\lib\python\OFS\DTMLMethod.py, line 194, in 
__call__
    (Object: DataForPie)
  File C:\Zope\BELENS~1\lib\python\DocumentTemplate\DT_String.py, line 
544, in __call__
    (Object: DataForPie)
  File C:\Zope\BELENS~1\lib\python\DocumentTemplate\DT_Let.py, line 
147, in render
    (Object: data="getDataForWeeklyReport(18)")
  File C:\Zope\BELENS~1\lib\python\DocumentTemplate\DT_Util.py, line 
230, in eval
    (Object: getDataForWeeklyReport(18))
    (Info: getDataForWeeklyReport)
  File <string>, line 2, in f
  File C:\Zope\BELENS~1
\lib\python\Products\ExternalMethod\ExternalMethod.py, line 281, in 
__call__
    (Object: getDataForWeeklyReport)
    (Info: ((18,), {}, None))
  File C:\Zope\BelenSite\Extensions\getDataForWeeklyReport.py, line 68, 
in getDataForWeeklyReport
    (Object: LockableItem)
TypeError: (see above)

When I test it on 2.3 the last line of the traceback says 
(Object:Traversable)

I have no clue what the problem might be. :-(
Any help will be really appreciated.

Thanks in advance

Belen



----7e5155d67b52694
Content-Type: text/plain
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="getDataForWeeklyReport.py"

aW1wb3J0IHN0cmluZyANCmZyb20gcmVwb3J0bGFiIGltcG9ydCBwbGF0eXB1cw0KZnJvbSBy
ZXBvcnRsYWIucGxhdHlwdXMgaW1wb3J0IFNpbXBsZURvY1RlbXBsYXRlLCBUYWJsZSwgVGFi
bGVTdHlsZQ0KZnJvbSByZXBvcnRsYWIucGxhdHlwdXMgaW1wb3J0ICoNCmZyb20gcmVwb3J0
bGFiLnBsYXR5cHVzLnBhcmFncmFwaCBpbXBvcnQgUGFyYWdyYXBoDQpmcm9tIHJlcG9ydGxh
Yi5wbGF0eXB1cy5kb2N0ZW1wbGF0ZSBpbXBvcnQgKg0KZnJvbSByZXBvcnRsYWIubGliLnN0
eWxlcyBpbXBvcnQgUHJvcGVydHlTZXQsIGdldFNhbXBsZVN0eWxlU2hlZXQNCmZyb20gc3Ry
aXBvZ3JhbSBpbXBvcnQgaHRtbDJ0ZXh0LCBodG1sMnNhZmVodG1sDQppbXBvcnQgcmVwb3J0
bGFiLmxpYi5jb2xvcnMNCmltcG9ydCBQSUwuSW1hZ2UNCg0KDQpkZWYgcHJlZm9ybWF0KG1z
ZykgOg0KCQltc2cgPSBzdHJpbmcucmVwbGFjZShtc2csICImIiwgIiZhbXA7IikNCgkJbXNn
ID0gc3RyaW5nLnJlcGxhY2UobXNnLCAiPiIsICImZ3Q7IikNCgkJcmV0dXJuIHN0cmluZy5y
ZXBsYWNlKG1zZywgIjwiLCAiJmx0OyIpDQoNCg0KDQoNCg0KZGVmIGdldERhdGFGb3JXZWVr
bHlSZXBvcnQoc2VsZiwgZGF0YSk6DQogICAgICAgIGRhdGFsaXN0PVtdDQogICAgICAgIHN0
eWxlPWdldFNhbXBsZVN0eWxlU2hlZXQoKVsnTm9ybWFsJ10NCiAgICAgIC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ICAgICAgICAgICAgICAgIA0KICAgICAg
ICAgICANCiAgICAgICAgICAgIA0KICAgICAgICAgICAgDQogICAgICAgIA0KICAgICAgICAg
ICAgDQogICAgICAgICAgICANCg0KCQ0K

----7e5155d67b52694--