<html>
<!-- BEGIN WEBMAIL STATIONERY -->
<head></head>
<body>
<!-- WEBMAIL STATIONERY noneset -->
<DIV></DIV>
<P>Hi Jonathon,</P>
<P> </P>
<P>I will adjust my code. I have written some Python code but very simple tasks and would like to do more. I don't program that often. I work for a school system in Connecticut. So if you have an example of what your are talking about I am willing to try it. </P>
<P> </P>
<P>Thanks again,</P>
<P> </P>
<P>Larry<BR></P>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">-------------- Original message from "Jonathan" <dev101@magma.ca>: -------------- <BR><BR><BR>> <SNIP><BR>> ----- Original Message ----- <BR>> From: larrymcdonnell@att.net <BR>> To: zope@zope.org <BR>> Sent: Thursday, July 13, 2006 4:03 PM <BR>> Subject: [Zope] Creating and displaying lists <BR>> <BR>> I need to collect a list of student id numbers from one table so I can take <BR>> this list, find them in another table, and display their names so their <BR>> teachers can give them a score. <BR>> <BR>> I still like to use DTML but I do not know if I have the sequence-number in <BR>> the proper format. This is what I have been playing with: <BR>> <BR>> <DTML-CALL REQUEST.SESSION[?RECORD_ID?])? ?REQUEST.set(?RECORD_ID?,><BR>> <DTML-IN lookup_students_in_course><BR>> <DTML-CALL student_id)? ?REQUEST.set(?student_id_temp?,><BR>> </DTML-IN><
BR>> <DTML-IN expr="_.range(sequence-number)"><BR>> <DTML-CALL ?REQUEST.set(?student_id_temp?, student_id_temp)?><BR>> <SELECT name=student_id_selected> > <OPTION value="" selected></OPTION> > <DTML-IN sort="student_last_name" lookup_student_name> > <OPTION value="<dtml-var student_id>">> <DTML-VAR student_last_name>, <DTML-VAR student_first_name> ></OPTION> > ></SELECT> <BR>> </DTML-IN><BR>> <BR>> </SNIP><BR>> <BR>> I think there is some confusion here. You should break this into 2 sections <BR>> (and it would be much easier in a python script), but if you want to use <BR>> dtml... <BR>> <BR>> The first section should build the list you are trying to display in the <BR>> SELECT statement. It looks like you are trying to create a list of 'tuples' <BR>> where each tuple consists of (id, lastname, firstname). I don't know where <BR>> your data is coming from, but you could do something like: <BR>> <BR>> <DTML-CAL
L [])? ?REQUEST.set(?studentList?,># creates an empty list <BR>> <BR>> <IN loop some><BR>> <DTML-CALL )? firstname) lastname, (id, ?studentList.append(># add one <BR>> tuple (record) to the list <BR>> <END loop of><BR>> <BR>> After you have built your list test it by displaying it: <DTML-VAR <BR>> studentList> to see if you have the right data in your list. <BR>> <BR>> You can then proceed to the next section where you are building your SELECT <BR>> statements (warning: not tested and very ugly dtml) <BR>> <BR>> <SELECT size=1 name=student_id_selected> > <DTML-IN studentList> > <OPTION value="<dtml-var " selected _[?sequence-item?][0]?>" > > <DTML-VAR ?_[?sequence-item?][1]?>, <DTML-VAR <BR>> "_['sequence-item'][2]"> ></OPTION> > ></SELECT> <BR>> <BR>> <BR>> hth & Good Luck <BR>> <BR>> <BR>> Jonathan <BR>> </BLOCKQUOTE>
<!-- END WEBMAIL STATIONERY -->
</body>
</html>