Re: [SQLObject] Fwd: [TurboGears] Hook for setting up a database environment
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Brad C. <bk...@mu...> - 2005-10-30 01:32:57
|
On 29 Oct 2005 at 9:41, Kevin Dangoor wrote: > I have seen this myself with kinterbasdb. The need to "init" the > module is a common one that needs to be done once. > > What do you think is the best way to do this? > > We could add init='my.callable' to the URI and then have the firebird > driver only run that the first time. Does that seem reasonable? I have a suggestion. I have been thinking about this problem too. it effects py.test and sqlobject-admin, so we need a general solution that will work in those environments too. so, if 'init=x.y.z' could drill down package, module, function and call it, that'd be good. oth, for py.test it'd be nice to call an init method that's not necessarily in the python path. I was musing about using type_conv=X since this is a kinterbasdb specific issue. then the firebird driver could examine the type_conv value, if it's all digits it could just pass that int value to kinterbasdb.init, otherwise it would treat the arg as a module to be imported and passed as the type_conv value. This is specific to the way kinterbasdb's init method works now. It might not work this way in the future. (using init= as the param name might result in a collision later if a more general init param is supported by sqlobject itself, perhaps in the sqlobject-admin case... -- Brad Clements, bk...@mu... (315)268-1000 http://www.murkworks.com AOL-IM or SKYPE: BKClements |