[Zope] Change db connect string in python or dtml

Craig Allen cba@mediaone.net
Wed, 02 Aug 2000 21:26:52 -0400


Magnus Heino wrote:
> How can I change the 'Database Connection String' and then then try to
> connect, either in dtml or python?
I think I understand what you are asking, since I am developing a database app
and have switched about 20 methods back and forth between two database
servers... it gets tedious.  I assume you want a more automated way to do this,
and it should be possible to write a python script (External method?) to do
this, although I'm not sure how you would find all the ZSQL methods where you
would do this.  Perhaps something like this (the find form):
http://www.yourserver.com/yourfolder/manage_findResult?obj_metatypes%3Alist=Z+Gadfly+Database+Connection&obj_ids%3Atokens=&obj_searchterm=&obj_mspec=%3C&obj_mtime=&search_sub%3Aint=1&btn_submit=Find

As a quick and dirty alternative (untested), just edit your connection
parameters in your Mysql connector to point to the different server (you'll want
to close the connection first, I expect).
-- 
Craig Allen  - Managing Partner - Mutual Alchemy
Web Architecture - http://alchemy.nu