Hi all I have a script that returns a list of dictionaries to a ZPT. I have tried all I knew without success in printing out the results in a table. In the following ZPT the address at list should be visible. It does not !! ------------ZPT Start------------------------- <table tal:define="Empp python:request.AUTHENTICATED_USER"> <tbody tal:define="Reps python:here.GetMyRecentDataPython"> <tr tal:content="Reps"> </tr> </tbody> </table> --------------ZPT End-------------------------- The script looks like ------------Script Start-------------------------- request = container.REQUEST RESPONSE = request.RESPONSE GotRecentData=container.GetMyRecentDataSQL(EmpID=request.EmpID).dictionaries() return GotRecentData ------------Script End------------------------------- There are no issues with the SQL and Script. They provide just the right output if tested seprately from ZPT. I am struck. Here is the error message ------------------Error Message Start--------------- Site Error An error was encountered while publishing this resource. *TALESError* Sorry, a site error occurred. Traceback (innermost last): File /home/sepg/Site2/lib/python/ZPublisher/Publish.py, line 150, in publish_module File /home/sepg/Site2/lib/python/Products/Localizer/__init__.py, line 65, in new_publish File /home/sepg/Site2/lib/python/ZPublisher/Publish.py, line 114, in publish File /home/sepg/Site2/lib/python/Zope/__init__.py, line 158, in zpublisher_exception_hook (Object: My Recent Data) File /home/sepg/Site2/lib/python/ZPublisher/Publish.py, line 98, in publish File /home/sepg/Site2/lib/python/ZPublisher/mapply.py, line 88, in mapply (Object: index_html) File /home/sepg/Site2/lib/python/ZPublisher/Publish.py, line 39, in call_object (Object: index_html) File /home/sepg/Site2/lib/python/Shared/DC/Scripts/Bindings.py, line 252, in __call__ (Object: index_html) File /home/sepg/Site2/lib/python/Shared/DC/Scripts/Bindings.py, line 283, in _bindAndExec (Object: index_html) File /home/sepg/Site2/lib/python/Products/PageTemplates/ZopePageTemplate.py, line 207, in _exec (Object: index_html) File /home/sepg/Site2/lib/python/Products/PageTemplates/PageTemplate.py, line 86, in pt_render (Object: index_html) (Info: {'container': <Folder instance at 93dce58>, 'here': <Folder instance at 93dce58>, 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x869b764>, 'nothing': None, 'options': {'args': ()}, 'request': <h3>form</h3><table></table><h3>cookies</h3><table><tr valign="top" align="left"><th>__ac_name</th><td>'0530'</td></tr></table><h3>lazy items</h3><table><tr valign="top" align="left"><th>SESSION</th><td><Python Method object at 0x8d350b8></td></tr></table><h3>other</h3><table><tr valign="top" align="left"><th>AUTHENTICATION_PATH</th><td>'ActivityWork'</td></tr><tr valign="top" align="left"><th>URL1</th><td>'http://192.168.2.47:8080/ActivityWork/My%20Recent%20Data'</td></tr><tr valign="top" align="left"><th>PUBLISHED</th><td><ZopePageTemplate instance at 9318e58></td></tr><tr valign="top" align="left"><th>URL3</th><td>'http://192.168.2.47:8080'</td></tr><tr valign="top" align="left"><th>__ac_name</th><td>'0530'</td></tr><tr valign="top" align="left"><th>BASE3</th><td>'http://192.168.2.47:8080/ActivityWork/My%20Recent%20Data'</td></tr><tr valign="top" align="left"><th>URL2</th><td>'http://192.168.2.47:8080/ActivityWork'</td></tr><tr valign="top" align="left"><th>BASE1</th><td>'http://192.168.2.47:8080'</td></tr><tr valign="top" align="left"><th>traverse_subpath</th><td>[]</td></tr><tr valign="top" align="left"><th>URL0</th><td>'http://192.168.2.47:8080/ActivityWork/My%20Recent%20Data/index_html'</td></tr><tr valign="top" align="left"><th>SERVER_URL</th><td>'http://192.168.2.47:8080'</td></tr><tr valign="top" align="left"><th>BASE4</th><td>'http://192.168.2.47:8080/ActivityWork/My%20Recent%20Data/index_html'</td></tr><tr valign="top" align="left"><th>USER_PREF_LANGUAGES</th><td><Products.Localizer.AcceptLanguage.AcceptLanguage instance at 0x9ad6934></td></tr><tr valign="top" align="left"><th>URL</th><td>'http://192.168.2.47:8080/ActivityWork/My%20Recent%20Data/index_html'</td></tr><tr valign="top" align="left"><th>BASE2</th><td>'http://192.168.2.47:8080/ActivityWork'</td></tr><tr valign="top" align="left"><th>TraversalRequestNameStack</th><td>[]</td></tr><tr valign="top" align="left"><th>AUTHENTICATED_USER</th><td>0530</td></tr><tr valign="top" align="left"><th>BASE0</th><td>'http://192.168.2.47:8080'</td></tr><tr valign="top" align="left"><th>URL0</th><td>http://192.168.2.47:8080/ActivityWork/My%20Recent%20Data/index_html</td></tr><tr valign="top" align="left"><th>URL1</th><td>http://192.168.2.47:8080/ActivityWork/My%20Recent%20Data</td></tr><tr valign="top" align="left"><th>URL2</th><td>http://192.168.2.47:8080/ActivityWork</td></tr><tr valign="top" align="left"><th>URL3</th><td>http://192.168.2.47:8080</td></tr><tr valign="top" align="left"><th>BASE0</th><td>http://192.168.2.47:8080</td></tr><tr valign="top" align="left"><th>BASE1</th><td>http://192.168.2.47:8080</td></tr><tr valign="top" align="left"><th>BASE2</th><td>http://192.168.2.47:8080/ActivityWork</td></tr><tr valign="top" align="left"><th>BASE3</th><td>http://192.168.2.47:8080/ActivityWork/My%20Recent%20Data</td></tr><tr valign="top" align="left"><th>BASE4</th><td>http://192.168.2.47:8080/ActivityWork/My%20Recent%20Data/index_html</td></tr></table><h3>environ</h3><table><tr valign="top" align="left"><th>HTTP_KEEP_ALIVE</th><td>'300'</td></tr><tr valign="top" align="left"><th>HTTP_ACCEPT_ENCODING</th><td>'gzip, deflate, compress;q=0.9'</td></tr><tr valign="top" align="left"><th>channel.creation_time</th><td>1034356075</td></tr><tr valign="top" align="left"><th>SERVER_PROTOCOL</th><td>'HTTP/1.1'</td></tr><tr valign="top" align="left"><th>SERVER_PORT</th><td>'8080'</td></tr><tr valign="top" align="left"><th>PATH_INFO</th><td>'/ActivityWork/My Recent Data'</td></tr><tr valign="top" align="left"><th>HTTP_HOST</th><td>'192.168.2.47:8080'</td></tr><tr valign="top" align="left"><th>REQUEST_METHOD</th><td>'GET'</td></tr><tr valign="top" align="left"><th>PATH_TRANSLATED</th><td>'/ActivityWork/My Recent Data'</td></tr><tr valign="top" align="left"><th>HTTP_COOKIE</th><td>'__ac="MDUzMDpwbG8wOTg%3D%0A"; __ac_name="0530"'</td></tr><tr valign="top" align="left"><th>SCRIPT_NAME</th><td>''</td></tr><tr valign="top" align="left"><th>SERVER_SOFTWARE</th><td>'Zope/(Zope 2.5.0 (binary release, python 2.1, linux2-x86), python 2.1.3, linux2) ZServer/1.1b1'</td></tr><tr valign="top" align="left"><th>HTTP_ACCEPT_LANGUAGE</th><td>'en-us, en;q=0.50'</td></tr><tr valign="top" align="left"><th>HTTP_ACCEPT</th><td>'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1'</td></tr><tr valign="top" align="left"><th>REMOTE_ADDR</th><td>'192.168.2.47'</td></tr><tr valign="top" align="left"><th>HTTP_REFERER</th><td>'http://192.168.2.47:8080/ActivityWork/My%20Recent%20Data'</td></tr><tr valign="top" align="left"><th>SERVER_NAME</th><td>'eddy'</td></tr><tr valign="top" align="left"><th>GATEWAY_INTERFACE</th><td>'CGI/1.1'</td></tr><tr valign="top" align="left"><th>HTTP_USER_AGENT</th><td>'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826'</td></tr><tr valign="top" align="left"><th>HTTP_ACCEPT_CHARSET</th><td>'ISO-8859-1, utf-8;q=0.66, *;q=0.66'</td></tr><tr valign="top" align="left"><th>CONNECTION_TYPE</th><td>'keep-alive'</td></tr></table>, 'root': <Application instance at 9016250>, 'template': <ZopePageTemplate instance at 9318e58>, 'traverse_subpath': [], 'user': 0530}) File /home/sepg/Site2/lib/python/TAL/TALInterpreter.py, line 158, in __call__ File /home/sepg/Site2/lib/python/TAL/TALInterpreter.py, line 191, in interpret File /home/sepg/Site2/lib/python/TAL/TALInterpreter.py, line 523, in do_useMacro File /home/sepg/Site2/lib/python/TAL/TALInterpreter.py, line 191, in interpret File /home/sepg/Site2/lib/python/TAL/TALInterpreter.py, line 542, in do_defineSlot File /home/sepg/Site2/lib/python/TAL/TALInterpreter.py, line 191, in interpret File /home/sepg/Site2/lib/python/TAL/TALInterpreter.py, line 491, in do_condition File /home/sepg/Site2/lib/python/TAL/TALInterpreter.py, line 191, in interpret File /home/sepg/Site2/lib/python/TAL/TALInterpreter.py, line 413, in do_insertText_tal File /home/sepg/Site2/lib/python/Products/PageTemplates/TALES.py, line 269, in evaluateText File /home/sepg/Site2/lib/python/Products/PageTemplates/TALES.py, line 247, in evaluate File /home/sepg/Site2/lib/python/Products/PageTemplates/Expressions.py, line 189, in __call__ File /home/sepg/Site2/lib/python/Products/PageTemplates/Expressions.py, line 184, in _eval File /home/sepg/Site2/lib/python/Products/PageTemplates/Expressions.py, line 84, in render (Object: GetMyRecentDataPython) File /home/sepg/Site2/lib/python/Products/PageTemplates/ZRPythonExpr.py, line 75, in call_with_ns (Object: __render_with_namespace__) File /home/sepg/Site2/lib/python/Shared/DC/Scripts/Bindings.py, line 266, in __render_with_namespace__ (Object: GetMyRecentDataPython) File /home/sepg/Site2/lib/python/Shared/DC/Scripts/Bindings.py, line 283, in _bindAndExec (Object: GetMyRecentDataPython) File /home/sepg/Site2/lib/python/Products/PythonScripts/PythonScript.py, line 291, in _exec (Object: GetMyRecentDataPython) (Info: ({'script': <PythonScript instance at 9ac1318>, 'context': <Folder instance at 93dce58>, 'container': <Folder instance at 93dce58>, 'traverse_subpath': []}, (), {}, None)) TALESError: Sorry, an error occurred ------------------Errot Message End---------------- TIA Chetan
--On Freitag, 11. Oktober 2002 22:39 +0530 Chetan Kumar <chetan@cdacindia.com> wrote:
Hi all I have a script that returns a list of dictionaries to a ZPT. I have tried all I knew without success in printing out the results in a table.
In the following ZPT the address at list should be visible. It does not !!
------------ZPT Start------------------------- <table tal:define="Empp python:request.AUTHENTICATED_USER"> <tbody tal:define="Reps python:here.GetMyRecentDataPython"> ^^^^^^^^^^^^^^^^^^^^^ should be .GetMyRecentDataPython() ????!!!!
-aj
participants (2)
-
Andreas Jung -
Chetan Kumar