[Zope] [newbie] Z SQL methods ...help!?

Darcy Clark darcyc@engin.umich.edu
Sat, 20 Nov 1999 15:32:14 -0500


I am a Zope newbie working my way through the Z SQL Methods user guide (
http://www.zope.org/Documentation/Guides/ZSQL ) .... I made a simple
MySQL database, setup a connection to it, made a Z SQL method to access
my database ....then I  used the Search interface creation wizard to
create a query form and a report page. I tested it and it works great

My question has to do with alternative ways of accessing SQL data, other
than by going through a html query form.

Obviously one way to do it is to 'encode' the query into a URL - e.g.
http://darcy.engin.umich.edu:8080/Plutonia/MySQL_test/course_report?number=mse242

My question is as follows :

my MySQL table contains 2 fields : number and title

example data :

number    title
mse242    physics of materials
mse252    principles of engineering materials

I want to build a folder containing a Z SQL method - this folder has a
Property of 'course=mse242'. In this folder I have a page (DTML-method?)
that when accessed via the browser, will *automatically*  access the Z
SQL method, run a query based on the property 'course=mse242' and spit
out a page containing the number (mse242) and the title (physics of
materials).

What I want to get around is having to access a html query form to get
to a particular course....I want to store the course name in a folder's
properties and access this property automatically when I render any
pages in that folder. Can this be done ? Can my Z-SQL methods access
folder properties and then run queries on this basis ? If this is
possible can you refer me to any docs that address this ?

here is my current Z SQL method :

select *
from courses
where
<!--#sqltest number
 column=number type=string-->

I guess what I am shooting for here is to utilize acquisition within Z
SQL methods....I would not be surprised if I missing something *really*
basic here ....  curse my newbieness!!   :).

thanks in advance for any advice.

Darcy