[Zope] ZSQL method attribute name question

Michel Pelletier michel@digicool.com
Mon, 02 Aug 1999 16:45:04 -0400


Robert Carey wrote:
> 
> I would like to be able to write generic handlers for data returned by
> ZSQL methods.  To do this I need to know how to get access to the
> metadata for rows returned by ZSQL methods.
> 
> If I define a class and associate it with a ZSQL method using the
> Advanced tab of that method's management page, what is the right way for
> that class to learn the names of the columns returned by the query?
> 

ZSQL Methods return a sequence of record objects.  These record objects
are instanciated on the fly.  You can even specify a class in the
filesystem that defines your returned objects.  These are called
pluggable brains, and are probably what your looking for, because you
can define the actualy object returned to you, and don't have to go
sniffing on it to find out it's properties.

-Michel