def init(self):
if self._local_path:
dirname = os.path.dirname(self._local_path)
if dirname and not os.path.isdir(dirname):
os.makedirs(dirname)
if not database_exists(self.db.url):
create_database(self.db.url)
# More on connection strings for sqlalchemy:
# http://docs.sqlalchemy.org/en/latest/core/engines.html
self.metadata.bind = self.db
self.metadata.create_all()
评论列表
文章目录