[Zope] iteration through list with dtml-tags

Axel Bock news-and-lists at the-me.de
Wed Aug 7 00:41:41 CEST 2002


On Tue, 06 Aug 2002 15:12:33 +0200, John Hunter wrote:

>>>>>> "Axel" == Axel Bock <news-and-lists at the-me.de> writes:
> 
>     Axel> Hi, I have a little problem: an SQL query delivers me a list
>     Axel> of [(name, firstname, id, email), ...]  and I want to put Axel>
>     this in a table, but OUT OF ORDER.
> Unless I'm misunderstanding your problem, this should not present any
> difficulties.  For example, if your zope Z SQL Method is named
> 'select_sql', you can create the table like so:

no, i think you did well understand the problem. But I do not use ZSQL
methods, and I am getting a list of tuples, as I said. And these are not
so easily dereferenced (cause there are no names ... :-)

Up to now I came up with the following solution:
	<dtml-call "REQUEST.set('something', sequence-item)">
Which I can dereference as
	<dtml-var "something[x]">

I don't see another way. But you can tell me in which way I can access a
ZMySQLDatabaseconnection from within my own product, if this is not too
much a thing (I stole code from ZSQLMethod and fiddled it until I could
drop pure SQL queries the form SQL.query("..."))

Thanks anyway and greetings, 

		Axel.




More information about the Python-list mailing list