Hi all I have a form in ZPT which calls a python script which looks up a database to generate some data. Now, the data needs to appear in the same page in a table if the submit button is used. The problem here is to generate the <form method="post" action="GetProjectWiseDataPython"> further down the selection is made as <select name="ProjectName"> <option tal:repeat="options here/GetProjectsPython" tal:content="options/ProjectName">name</option> </select> </form> This is passed to GetProjectWiseDataPython. At the end of the page I need to put a condition "if data obtained from script" show the data obtained from GetProjectWiseDataPython Now, As I understand I need to tal:define="GotData here/GetProjectWiseDataPython" and later tal:content="GotData/Somedata" This is the error message I get while loading the page. *Error Type: TALESError * *Error Value: exceptions.AttributeError on ProjectName in "standard:'here/GetProjectWiseDataPython'", at line 52, column 1* This is not seen when I do not attempt to display the data. What is the way out ? TIA Chetan
Chetan Kumar wrote:
Hi all *Error Type: TALESError * *Error Value: exceptions.AttributeError on ProjectName in "standard:'here/GetProjectWiseDataPython'", at line 52, column 1*
Your script is raising an AttributeError on ProjectName, maybe you should fix it? ;-) cheers, Chris
Chris: I am interested in using the data returned by the script in the same page based on some condition. The submit button triggers the script taking iput. It calls a ZSQL method and returns the data. This data has to be given back to the requesting page. Now, at this moment when I say tal:define="Got here/ThePythonScript" The returned values are available to me under Got/Val1, Got/Val2. As the portion where this script is acting is within the <form> </form> these values are not available outside. On introducing the following without providing the necessary inputs the error I mentioned previously is logical. tal:define="Got here/ThePythonScript" I need to "define global" somewhere (maybe in the <form> </form> portion) so that the returned values are available later. Regards, Chetan
On Tue, Aug 20, 2002 at 02:38:14PM +0530, Chetan Kumar wrote:
tal:define="Got here/ThePythonScript"
I need to "define global" somewhere (maybe in the <form> </form> portion) so that the returned values are available later.
tal:define="global Got here/ThePythonScript" This can be found in the online version of the Zope Book (though I forget if it's in the basic or advanced chapters on Page Templates). --PW -- Paul Winkler "Welcome to Muppet Labs, where the future is made - today!"
* Chetan Kumar [08:29 20/08/02 CEST]:
Hi all I have a form in ZPT which calls a python script which looks up a database to generate some data. Now, the data needs to appear in the same page in a table if the submit button is used. The problem here is to generate the
<form method="post" action="GetProjectWiseDataPython">
further down the selection is made as
<select name="ProjectName"> <option tal:repeat="options here/GetProjectsPython" tal:content="options/ProjectName">name</option> </select>
</form>
This is passed to GetProjectWiseDataPython.
The way I do it is to call my page from the script this way return container.index_html( result = gnagnagna ) and in index_html options/result is where this result might be find -- (°> Nicolas Évrard / ) Liège - Belgique ^^
participants (4)
-
Chetan Kumar -
Chris Withers -
Nicolas Évrard -
Paul Winkler