[Z3-sqlos] Re: Error adapting connection

Andreas Elvers andreas at work.de
Tue Nov 1 14:49:01 CET 2005


Ben Godfrey wrote:

[...]

> In addition, I have a couple of questions:
> 
> How can I use connections created through the site management folder  
> instead of hard-coded into ZCML?

I'm just starting in zope3 so this may be wrong, but I don't think so :-)

This should be possible through local utilities and SiteManager.
On the management interface do:
Create a Folder
Enter Folder
Click on "Make a site". A SiteManager with a default Folder (you can 
have diffrent site folder).
Enter default folder.
Add your database adapter.
Register the Adapter ("register as" is the lookup name for sqlos)

In your configure.zcml where you define the sqlos stuff you should 
change the line:
<sqlos:connectionName name="psycopg" />
change psycopg against the name you put in "register as".

The manual work above can be put together in a special add view to make 
things work programmatically.

> Secondly, I'm interested in the possibility of building on top of sqlos  
> to make using SQLObjects one step more generic, i.e. creating SQLObject  
> classes from databases which in turn create interfaces which is all  
> patched together somehow with ZCML. The goal being that if you provide  
> a connection to a database you magically get a whole new set of  
> containers and types to add based on the structure of that database.

It is possible to create a container that (upon creation) will create 
other enclosed objects. You will need to write  a special AddView or use 
the nice initialization tool (have not tested this yet,but looks great) 
available from svn://svn.tiks.org/repos/Tiks/trunk/src/tiks/initializer.

That part with creating SQLObject classes from a database structure: 
don't know :-)

- Andreas




More information about the z3-sqlos mailing list