def _init_db(self):
    self.engine = create_engine(self.options['database_url'])
    self.session = Session(self.engine)
    if self.options.get('sql_path'):
        self._sqlite_load()
    self.metadata = MetaData()
    self.metadata.bind = self.engine
    self.base = automap_base(bind=self.engine, metadata=self.metadata)
    self.base.prepare(self.engine, reflect=True)
    self.models = {}
    for (name, mapping) in self.mapping.items():
        if (('table' in mapping) and (mapping['table'] not in self.models)):
            self.models[mapping['table']] = self.base.classes[mapping['table']]
def _init_db(self):
    self.engine = create_engine(self.options['database_url'])
    self.session = Session(self.engine)
    if self.options.get('sql_path'):
        self._sqlite_load()
    self.metadata = MetaData()
    self.metadata.bind = self.engine
    self.base = automap_base(bind=self.engine, metadata=self.metadata)
    self.base.prepare(self.engine, reflect=True)
    self.models = {}
    for (name, mapping) in self.mapping.items():
        if (('table' in mapping) and (mapping['table'] not in self.models)):
            self.models[mapping['table']] = self.base.classes[mapping['table']]