sabridge API¶
-
class
sabridge.Bridge¶ -
__getitem__(model_cls)¶ Returns the
sqlalchemy.schema.Tablerepresentation ofmodel_cls, adjango.db.models.Modelsubclass.Use dict-notation to obtain the
Table:>>> from myapp.models import mymodel >>> brige = Bridge() >>> mytable = bridge[mymodel] >>> print type(mytable) <class 'sqlalchemy.schema.Table'>
Bridgestores theTablefor 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.MetaDatainstance bound to the current Django database connection.
-