[Zope] Howto convert ZSQL results
Julián Muñoz Domínguez
jmunoz@softhome.net
Fri, 2 Nov 2001 16:21:38 +0000 (GMT)
How to convert to integer the the result of a ZSLQ method ??
I call a ZSQL method with:
l=int(container.last_customer())
The field I query is has the type "VARCHAR(10) with Null"
I am doing this query through ZODBC DA, to an Access .mdb file.
I am digging many hours in the Documentation, and doesn't find the answer.
I get this error:
Zope Error
Zope has encountered an error while publishing this resource.
Error Type: AttributeError
Error Value: DatabaseResults instance has no attribute
'__int__'
Troubleshooting Suggestions
The URL may be incorrect.
The parameters passed to this resource may be incorrect.
A resource that this resource relies on may be
encountering an error.
For more detailed information about the error, please refer
to the HTML source for this page.
If the error persists please contact the site maintainer.
Thank you for your patience.
Traceback (innermost last):
File E:\Archivos de programa\zwin\lib\python\ZPublisher\Publish.py, line
223, in publish_module
File E:\Archivos de programa\zwin\lib\python\ZPublisher\Publish.py, line
187, in publish
File E:\Archivos de programa\zwin\lib\python\Zope\__init__.py, line 226,
in zpublisher_exception_hook
(Object: LockableItem)
File E:\Archivos de programa\zwin\lib\python\ZPublisher\Publish.py, line
171, in publish
File E:\Archivos de programa\zwin\lib\python\ZPublisher\mapply.py, line
160, in mapply
(Object: start)
File E:\Archivos de programa\zwin\lib\python\ZPublisher\Publish.py, line
112, in call_object
(Object: start)
File E:\Archivos de
programa\zwin\lib\python\Shared\DC\Scripts\Bindings.py, line 324, in
__call__
(Object: start)
File E:\Archivos de
programa\zwin\lib\python\Shared\DC\Scripts\Bindings.py, line 354, in
_bindAndExec
(Object: start)
File E:\Archivos de
programa\zwin\lib\python\Products\PythonScripts\PythonScript.py, line 363,
in _exec
(Object: start)
(Info: ({'script': <PythonScript instance at 065706C0>, 'context':
<Folder instance at 0205E010>, 'container': <Folder instance at 0205E010>,
'traverse_subpath': []}, (), {}, None))
File Script (Python), line 8, in start
(Object: guarded_getattr)
AttributeError: (see above)
--
__o
_ \<_
(_)/(_)
Saludos de Julián
EA4ACL
-.-