[Zope] accessing dtml-in SQL variables

Lalo Castro laloc at cats.ucsc.edu
Thu Dec 18 19:20:06 EST 2003


Hi,
	What is the syntax (if it exists) for accessing SQL fields from a 
<dtml-in>?  For example, say you had a SQL method that performed a 
'select * from data_base'.  If you called that SQL method by <dtml-in 
"SQL_method(variables)"> that would return the entries in the database. 
  Then you could directly show those entries using the names of the 
database fields as variables.
	But, how could you call those entries (variables) without explicitly 
using the names of the database fields?  I'm looking for something like 
the sequence-item tag, where the name of the variable itself isn't needed.
	Those entry/variables are pushed onto the name space, but I'm not sure 
how to access the name space to get those variables.
	Our location is using Zope 2.6 and Python 2.1.3
	The context to this is we are building a generic SQL adaptor from scratch 
using Zope.  The modify function (calling an UPDATE SQL method) contains 
2 Forms, one to search for applicable entries and the second to narrow 
down the search of entries to modify.  Both use a SQL method that 
searches the database.  The method is called from <dtml-in 
"SQL_method(variables)".  When it returns those entries we have to 
hand-code all those names/values to be changed into the function itself, 
for each table, and each database.  This would be much easier if there 
was a way to call the database fields returned from a <dtml-in 
select_all_method> without explicitly naming the fields.
	If anyone knows how to call those variables in a generic way, or has a 
better way for doing this than we've described, please let us know.
		Thanks in advance.
-- 
Lalo Castro
Programmer/Analyst
McHenry Library
(831) 459-5208




More information about the Zope mailing list