Hello, I am having a problem with calling multiple Z SQL Methods from within Page Templates. What I need to accomplish is calling a Z SQL Method using a parameter value from another Z SQL Method. My code looks like: <p tal:repeat="cd container/z_sql_methods/select_cd"> <span tal:replace="cd/cd_title">CD Title</span> <ul tal:repeat="song container/z_sql_methods/select_songs"> <li content="song/song_title">Song Tile</li> </ul> </p> As you can see I have two Z SQL Methods, namely "select_cd" and "select_songs". For every CD that is in the database, the songs need to be retrieved. This is done by using the second Z SQL Method that takes one parameter, "cd_id". How can i pass this parameter "cd_id" in the TAL statement? I have looked through the available docs, but couldn't find the solution. Can someone please help me or point to a relevent piece of documentation? Thanks in advance!! Arjan Huijzer __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
on or about, Monday, February 03, 2003, we have reason to believe that Arjan Huijzer wrote something along the lines of :
I am having a problem with calling multiple Z SQL Methods from within Page Templates. What I need to accomplish is calling a Z SQL Method using a parameter value from another Z SQL Method.
My code looks like:
<p tal:repeat="cd container/z_sql_methods/select_cd"> <span tal:replace="cd/cd_title">CD Title</span> <ul tal:repeat="song container/z_sql_methods/select_songs"> <li content="song/song_title">Song Tile</li> </ul> </p>
You'll have to use a python statement: something like this: <ul> <li tal:repeat="song python:container.z_sql_methods.select_songs(cd=cd.cd_id)" tal:content="song/song_title"> Song Tile </li> </ul> Note that i also moved your repeat statement into the <li>, so that you get list items for each song, not a new list with one item.. :) -- Geir Bækholt geir@funcom.com Web Application/HCI-designer Product Operations Funcom Oslo
also sprach Arjan Huijzer <huijzer72@yahoo.com> [2003.02.03.1520 +0100]:
<p tal:repeat="cd container/z_sql_methods/select_cd"> <span tal:replace="cd/cd_title">CD Title</span>
<ul tal:define="cdid cd/id"> <li tal:repeat="song python:container.z_sql_methods.select_songs(cd_id=cdid)"> <span tal:replace="song/song_title" /> </li> </ul>
</p>
-- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck NOTE: The pgp.net keyservers and their mirrors are broken! Get my key here: http://people.debian.org/~madduck/gpg/330c4a75.asc why didn't noah swat those two mosquitoes?
participants (3)
-
Arjan Huijzer -
Geir B�kholt -
martin f krafft