Thanks, searching for documentation
Hi, First, thanks to everyone that gave me help while I've been learning Zope. It is much appreciated! In the QuickStart material, there are three things mentioned for which I am interested but have been able to find absolutely zero documentation. These are: * Aqueduct * Tabula * Pluggable Brains Where can I find information about them? Thanks, John
At 11:54 AM 9/6/99 -0500, John Goerzen wrote:
Hi,
First, thanks to everyone that gave me help while I've been learning Zope. It is much appreciated!
In the QuickStart material, there are three things mentioned for which I am interested but have been able to find absolutely zero documentation. These are:
* Aqueduct * Tabula * Pluggable Brains
Sorry, I can't direct you to any info other than the archive. I'll save you some time on the pluggable-brains one and paste what I found to be one of the best posts in the archive. (basically, pluggable brains are middleware objects in dire need of a better name). Anyway, hope the following helps -
People, Can someone point me to some documentation, messages or source code that will give me a handle on what 'pluggable brains' are and what I can do with them?
Rob Page has just made a post saying that Zope/ZODB3/pluggable brains can go a long way to integrating with relational databases and I want to make sure I've got a clue about all this! :)
thanks tone out,
I was going to refer you the ZSQL Methods User Guide, but I just looked and it just barely mentions the concept of pluggable brains at the moment :(
Simply put, pluggable brains means that you can associate a class that you've written in Python with the result record objects for a given SQL query. You can create a .py module in your Extensions directory (brain.py, for example) with a class definition such as:
class SimpleBrain: """A simple example brain."""
def fullname(self): return self.first_name + self.last_name
Now you create an SQLMethod, which for the sake of our example might look like:
select first_name, last_name from employees
This query (like all queries) will return a sequence of "record" objects, where each record object exposes its data as if the fields were object attributes.
Now, if you go to the "advanced" tab for a query, you can enter the module and class name of a class that will be added as a "mixin" to the normal record object behavior. Just like defining an external method, you enter the module name (in Extensions) and the class name to be used.
*Now* when you run the query, the record objects will also have your custom class mixed in - now they can have not only their data exposed as if they were Python attributes, but custom behavior too. In our example above, if you made brain.SimpleBrain the "pluggable brain" for our SQL method, you can now do:
<!--#in myquery--> <!--#var fullname--> <!--#/in-->
...in DTML, because fullname is provided by the class that is mixed into the resulting record objects. The only real rule to keep in mind is that your "brain" must be a mixin class (e.g. you can't have an __init__ that expects any arguments).
Hope this helps!
Brian Lloyd brian@digicool.com
* Aqueduct
The old name for Z SQL Methods. Also connected to a commercial Client-Server model for Zope 1.x and RDBMSs, I believe. Might be deprecated by ZEO?
* Tabula
Now called ZTables, also a commercial Zope add-on. Fast datastorage for Zope, parts of wivh are now part of Zope. The Collector is build using ZTables. ZCatalog is build using the integrated parts.
* Pluggable Brains
Smarter Z SQL record objects. By default a result set of a SQL query consists of pretty dumb classes, but you can define a class (in a module in your Extensions directory) that can be mixed in. See the advanced tab of your Z SQL Method, and the source. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ---------------------------------------------
participants (3)
-
chas -
John Goerzen -
Martijn Pieters