Previous topic

django-sabridge - SQLAlchemy access to Django models

Next topic

Developing django-sabridge

This Page

sabridge API

class sabridge.Bridge

Returns the sqlalchemy.schema.Table representation of model_cls, a django.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 the Table for the lifetime of the Bridge, thus table reflection only occurs once per model for the Bridge.


Build a URL for sqlalchemy.create_engine() based upon the database defined by django.db.connection


sqlalchemy.schema.MetaData instance bound to the current Django database connection.