首页 > Sqlalchemy框架,版本控制插件出错?

Sqlalchemy框架,版本控制插件出错?

sqlalchemy-continuum

article = Article(name=u'Some article', content=u'Some content')
session.add(article)
session.commit()**

执行的时候,报错:

cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (OperationalError) no such table: transaction 'INSERT INTO "transaction" (issued_at, remote_addr, user_id) VALUES (?, ?, ?)' ('2014-11-13 01:10:29.686800', None, None)

系统环境:

Linux hawk 3.11.0-26-generic #45-Ubuntu SMP Tue Jul 15 04:02:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Python 3.3.2+ (default, Feb 28 2014, 00:52:16) 
[GCC 4.8.1] on linux

no such table 报错信息很明显,这个 commit() 执行的是 insert 操作,而你的数据库却没有对应的 table。那个插件应该没说明白,大概需要用 sqlalchemy 原生的方式 create_table

【热门文章】
【热门文章】