[Zope] Passing data to/from Python

sathya linuxcraft@redspice.com
Sun, 26 Mar 2000 20:04:53 -0600


On Sun, 26 Mar 2000, you wrote:
> 
> 1. It seems that the only way to establish a DB connection is
> through Gadfly. There are warnings everywhere that Gadfly is
> inefficient. Therefore, I want to use ODBC (ODBC.Windows), like I
> did before. How?
Gadfly is just one of  the db's you can use. The aquaduct product family gives
you many options
 look at http://www.zope.org/Products/DA/ZODBCDA for the ODBC
adapter.  This is defenitely the easier way 
> 
> 2. I might eventually need to do complex calculations on the
> retrieved data, so I would prefer using Python code in an
> external method,  

You can do quite a bit with dtml unless of course you prefer python  and
sometimes it is easier to do stuff in python,  dtml is not a replacement by
any means

>     
> 
> 3. What if my Python function in my external method wants to
> return information to my DTML method? For instance, how do I
> return a Python list, and what do I do in my DTML method to
> process it (e.g., output a line for every member of the list)?
return a list and process it using  <dtml-in > which behaves  very similar to a
database cursor 
>  Can
> I pass the "name" as an argument to a DTML method?
Absolutely with the dtml  programming you can do the same things and more 
All the form variables show up in the REQUEST object and become part of the
namespace in your script,you can use them like any other variable in the
script    
-- 
##########################
 necessity is the 
mother of invention
##########################