Commits

Mike Bayer  committed 9dffcec

engine property allows polymorphic access to get_engine/set_engine

  • Participants
  • Parent commits b7d7bfc

Comments (0)

Files changed (1)

File lib/sqlalchemy/ext/proxy.py

     def set_engine(self, engine):
         raise NotImplementedError
         
-    engine = property(get_engine, set_engine)
+    engine = property(lambda s:s.get_engine(), lambda s,e:s.set_engine(e))
 
     def reflecttable(self, table):
         return self.get_engine().reflecttable(table)
             self._engine= create_engine( dburi, self.opts, **self.kwargs )
         return self._engine
 
-    def set_engine(self, engine):
-        raise NotImplementedError
-        
-    engine = property(get_engine, set_engine)
 
             
 class ProxyEngine(BaseProxyEngine):
     def set_engine(self, engine):
         self.storage.engine = engine
         
-    engine = property(get_engine, set_engine)
-            
 
 class ProxyType(object):
     """ProxyType base class; used by ProxyTypeEngine to construct proxying