[Zope] sql query results -> DTML method problem
Lee Reilly CS1997
lreilly@cs.strath.ac.uk
Sat, 16 Dec 2000 16:28:41 +0000
Hi,
I have a TINY problem, which I think there is a simple solution too...
but for the life of me, I can't find it! I'd be grateful if someone
could point me in the right direction.
I have a database setup containing details of classes, students &
lecturers. The user is prompted to enter a class code (a unique key)
which is used to query the database and return the class title. Simple.
A DTML method prompts me for the class code
-- I enter 52.139 and it posts to a method 'enterClassCodeAction',
below.
#1 <dtml-var standard_html_header>
#2 <h2>Confirm</h2>
#3 <p>You entered <i><dtml-var class_code></i></p>
#4
#5 <p>
#6 Our records show that <dtml-var class_code> is called
#7
#8 <dtml-in expr="findClassTitle(code=52.139)">
#9 <dtml-var title>
#10 </dtml-in>
#11
#12
#13 </p>
#14 <dtml-var standard_html_footer>
^ The method works fine when the class code is manually inserted (line
#8) but when I try to pass the variable from the previou post, held in
<dtml-var class_code> I have probs.
<dtml-in expr="findClassTitle(code=<dtml-var class_code>)"> *** syntax
error
findClassTitle is a ZSQL method for returning the class title given a
class code:
select title from classes
where <dtml-sqltest code op=eq type=float>
Hmm... anyone see the problem?
Thanks a lot :)
- Best regards,
Lee