[Zope] Pluggable brains?

Alexander Staubo alex@mop.no
Mon, 5 Jul 1999 02:28:42 +0200


Uh, so "pluggable brains" _is_ the ability for Zope to return records as
instances of a user-definable class?

It may be a vivid term, but descriptive it ain't. :-)

I have a related question. I need to post-process a query result set
using Python; I simply want to (a) go through each record and add (or
set) a column, and (b) reorder the records. Can you give me a simple
example of how to do this? As far as I can see, records returned by SQL
Methods are instances of a special class "r" which descends from Record,
Acquisition.Implicit and an optional user-defined class (the "brain", I
guess). It seems that when such an instance is created, each column is
set as an attribute on the instance. If so, I guess I can simply put the
records into a list, add my column as a vanilla Python attribute, and
reorder them as I wish, and then return them for use in DTML? Correct?

--
Alexander Staubo             http://www.mop.no/~alex/
"Reality is that which, when you stop believing in it, doesn't go
away."
--Philip K. Dick

>-----Original Message-----
>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
>Phillip J. Eby
>Sent: 5. juli 1999 02:20
>To: Alexander Staubo; Zope Mailing List (E-mail)
>Subject: Re: [Zope] Pluggable brains?
>
>
>At 01:07 AM 7/5/99 +0200, Alexander Staubo wrote:
>>Could somebody explain the concept of pluggable brains? I have come
>>across this phrase more than once, and I still don't know
>what it is. Is
>>there any documentation on this?
>>
>>Is it by any chance related to an SQL Method's ability to
>represent data
>>records with Python classes?
>
>Yes.  Sorry for the term, I picked it up from Jim Fulton back
>when it was
>an about-to-be-added feature for Principia/Aqueduct.  As with so many
>Fultonisms, it's vivid and tends to stick in one's
>(non-pluggable) brain.
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://www.zope.org/mailman/listinfo/zope
>
>(For developer-specific issues, use the companion list,
>zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>