summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/proxy.py
diff options
context:
space:
mode:
authorjeff <none@none>2006-02-27 15:36:48 +0000
committerjeff <none@none>2006-02-27 15:36:48 +0000
commit84a43c5cf9698287ea303701a9e865b2ca4570e6 (patch)
tree94999b1d2d3ed1cea00babca392002697c3d2cca /lib/sqlalchemy/ext/proxy.py
parentd368fd17d916b5a34490e27099cf39c127622270 (diff)
downloadsqlalchemy-84a43c5cf9698287ea303701a9e865b2ca4570e6.tar.gz
Added code to make foreignkey on ActiveMapper accept a string and create the ForeignKey object on the fly. Also added ability to pass args and kwargs to Column constructor. ActiveMapper columns can have keyword args indexed and unique which will automatically create a index or a unique index. dburi in AutoConnectEngine can be a callable.
Diffstat (limited to 'lib/sqlalchemy/ext/proxy.py')
-rw-r--r--lib/sqlalchemy/ext/proxy.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ext/proxy.py b/lib/sqlalchemy/ext/proxy.py
index dc0260608..d9a830c66 100644
--- a/lib/sqlalchemy/ext/proxy.py
+++ b/lib/sqlalchemy/ext/proxy.py
@@ -65,7 +65,11 @@ class AutoConnectEngine(BaseProxyEngine):
def get_engine(self):
if self._engine is None:
- self._engine= create_engine( self.dburi, self.opts, **self.kwargs )
+ if callable(self.dburi):
+ dburi= self.dburi()
+ else:
+ dburi= self.dburi
+ self._engine= create_engine( dburi, self.opts, **self.kwargs )
return self._engine
def set_engine(self, engine):