Hi Philipp, --On Sonntag, 27. Mai 2001 16:08 +0200 Philipp Robbel <philipp.robbel@eml.villa-bosch.de> wrote:
Hello again,
Allright :-) I have cached the results of a sql-Method via <dtml-let DATA=sqlListProjects>. GroupID ProjectID Project 1 1 "Gurr" 1 2 "Muh" 2 3 "Ih-Ah" 3 4 "Mähh" 3 5 "WauWau"
A second sqlMethod (sqlCount) returns: Count | 2 | ---- | 1 | ---- | 2 | ...
The two sql-Methods are related: Count shoes, how many Projects belong to one GroupID. Now imagine that I want to print out the projects in the following way:
GroupID 1: Gurr, Muh
GroupID 2: Ih-Ah
GroupID 3: Mäh, WauWau
First of all, you dont have to cache SQL results via dtml-let. Zope does this already for you. If you have 2 queries: sqlGroupList: SELECT DISTINCT GroupID FROM Projects and the other: sqlProjectList(arg_GroupID) SELECT ProjectID, Project FROM Projects WHERE GroupID=<dtml-arg_GroupID type=int> so you can: <dtml-in sqlGroupList> GroupID &dtml-GroupID;: <dtml-in "sqlProjectList(arg_GroupID=GroupID)"> <dtml-unless sequence-start>,</dtml-unless> <dtml-var Project> </dtml-in> </dtml-in> This looks a bit cleaner imho ;) Regards Tino Wildenhain