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
belen@netcom.no writes:
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): .... (Object: getDataForWeeklyReport) (Info: ((18,), {}, None)) File C:\Zope\BelenSite\Extensions\getDataForWeeklyReport.py, line 68, in getDataForWeeklyReport (Object: LockableItem) TypeError: (see above) When you get a traceback, you look at "Error Type", "Error Value" and usually a few traceback lines near the traceback end.
In your case, in line 68 of "getDataForWeeklyReport.py" an object (instance) is created with one missing argument. The constructor (__init__) wants 3 arguments but it is called with only one. Note, that the first parameter, is provided automatically, unless "__init__" is called explicitly. Thus, your code probably contains something like: <class>(arg) where "<class>" is the name of a Python class. Dieter
participants (2)
-
belen@netcom.no -
Dieter Maurer