[Zope] Creating and displaying lists
bluepaul at earthlink.net
Thu Jul 13 16:22:29 EDT 2006
larrymcdonnell at att.net wrote:
> I need to collect a list of student id numbers from one table so I can
> take this list, find them in another table, and display their names so
> their teachers can give them a score.
> I still like to use DTML but I do not know if I have the
> sequence-number in the proper format. This is what I have been playing
> <dtml-call "REQUEST.set('RECORD_ID', REQUEST.SESSION['RECORD_ID'])">
> <dtml-in lookup_students_in_course>
> <dtml-call "REQUEST.set('student_id_temp', student_id)">
> <dtml-in expr="_.range(sequence-number)">
> <dtml-call "REQUEST.set('student_id_temp', student_id_temp)">
> <SELECT NAME="student_id_selected">
> <option value=""></option>
> <dtml-in lookup_student_name sort=student_last_name>
> <OPTION VALUE="<dtml-var student_id>">
> <dtml-var student_last_name>, <dtml-var student_first_name>
> I am having a hard time find reference material on this.
I have an idea for you. Rewrite in python. Its easy to return a html
<select> structure from a python scripts and python scripts are so much
easier to think thru than dtml.
Then from your dtml (if i recall) you'd just <dtml-var
expr="yourPython()">. From tal use include the "structure" key word like:
<span tal:content="structure python:context.yourPython(params= ...)
If you get stuck re-ask (but give your version in python code) :-)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Zope