multiple database connections
Hi, First I have to say I've not tried what is discussed below, I'm just thinking about how this could be done... Say I have several relationnal databases, both have an identical structure. Since these databases are identical, all my ZSQL methods can be used with any of them. So I plan to architecture my Folder tree like that : Level0 | +-- ZSQLMethod1 +-- ZSQLMethod2 +-- ... +-- Level1-1 | | | +-- DAConnection | +-- ... some stuf specific to this database ... | +-- Level1-2 | +-- DAConnection +-- ... some stuff specific to this database ... Each DAConnection connects to a different database, but the id is identical in order for the ZSQL methods to find it in whichever folder they are called. Now the problem is : one can't create a ZSQL method if there's no DAConnection at the same level or above. I suppose that creating all my ZSQL methods in for example Level1-1, then cutting&pasting them in Level0 could work, but I find this very counter intuitive. And if this would work, then the ZSQL methods wouldn't be editable anymore since at Level0 there's no DA... So my question is : why the hell can't developpers create ZSQL methods as they see fit, and be allowed to type-in the name of a possibly not-yet-existing Database Connection ? After all, creating ZSQL methods isn't for end users, so maybe Zope could trust developpers in knowing exactly what they want to do... Adding a free text field and allowing a "Free" entry in the drop-down list in the ZSQL method creation form would help. The Test tab form could also be modified to allow the developper to choose any DA at test time. Any comment or a solution to do this the right way ? thanks in advance. Jerome Alet - alet@unice.fr - http://cortex.unice.fr/~jerome Fac de Medecine de Nice http://wwwmed.unice.fr Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE
On Thursday 07 March 2002 02:34 am, you wrote:
Hi,
So my question is : why the hell can't developpers create ZSQL methods as they see fit, and be allowed to type-in the name of a possibly not-yet-existing Database Connection ? After all, creating ZSQL methods isn't for end users, so maybe Zope could trust developpers in knowing exactly what they want to do...
part of this goes back to the old who is zope's target audience days, when content managers were supposed to use the zmi directly. plus its just generally less confusion, imo. that said, zope doesn't stop a *developer* from doing it themselves. ie, you can very easily call the factory method directly passing a connection id from a python script, or directly instantiate the zsql method in the product. kapil
On March 7, 2002 03:28 am, kapil thangavelu wrote:
part of this goes back to the old who is zope's target audience days, when content managers were supposed to use the zmi directly. plus its just generally less confusion, imo.
Getting rid of this assumption will solve lots of daft little issues like that for example why does a ZSQL Method need to be tied to a database at all? I've hacked ZSQL Method so you can change the database its connected to on the fly, this allows you to use one Method on multiple databases (for example switching between a development and production database). -- Andy McKay
On Thu, Mar 07, 2002 at 03:28:28AM -0800, kapil thangavelu wrote:
On Thursday 07 March 2002 02:34 am, you wrote:
not-yet-existing Database Connection ? After all, creating ZSQL methods isn't for end users, so maybe Zope could trust developpers in knowing exactly what they want to do...
that said, zope doesn't stop a *developer* from doing it themselves.
Thanks! Jerome Alet
participants (3)
-
Andy McKay -
Jerome Alet -
kapil thangavelu