I would like to use autoload to use an existings database. I know how to do it without declarative syntax (model/_init_.py):
def init_model(engine):
Check out the Using SQLAlchemy with Pylons tutorial on how to bind metadata to the engine in the init_model
function.
If the meta.Base.metadata.bind(engine)
statement successfully binds your model metadata to the engine, you should be able to perform this initialization in your own init_model
function. I guess you didn't mean to skip the metadata binding in this function, did you?