sabridge API¶
-
class
sabridge.
Bridge
¶ -
__getitem__
(model_cls)¶ Returns the
sqlalchemy.schema.Table
representation ofmodel_cls
, adjango.db.models.Model
subclass.Use dict-notation to obtain the
Table
:>>> from myapp.models import mymodel >>> brige = Bridge() >>> mytable = bridge[mymodel] >>> print type(mytable) <class 'sqlalchemy.schema.Table'>
Bridge
stores theTable
for the lifetime of theBridge
, thus table reflection only occurs once per model for theBridge
.
-
connection_url
()¶ Build a URL for
sqlalchemy.create_engine()
based upon the database defined bydjango.db.connection
-
meta
¶ sqlalchemy.schema.MetaData
instance bound to the current Django database connection.
-