Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Call me before using any of the tables or classes in the model

        def init_model(engine):
    """Call me before using any of the tables or classes in the model"""
    ## Reflected tables must be defined and mapped here
    #global reflected_table
    #reflected_table = sa.Table("Reflected", meta.metadata, autoload=True,
    #                           autoload_with=engine)
    #orm.mapper(Reflected, reflected_table)
    #
    #sm = orm.sessionmaker(autoflush=True, autocommit=False, bind=engine)

    #meta.Session = orm.scoped_session(sm)
    #meta.engine = engine

    meta.Session.configure(bind=engine)
    meta.engine = engine


    log.debug('model init: init_model')
        


src/l/i/LinOTP-2.6.1.1/linotp/config/environment.py   LinOTP(Download)
    # the entries from the config file. if it is loaded at the top of the file,
    #the pylons.config does not contain the config file, yet.
    from linotp.model import init_model
    engine = engine_from_config(config, 'sqlalchemy.')
    init_model(engine)