Python的ORM框架,SQLObject 1.3.1 发布
jopen 12年前
<p><a href="/misc/goto?guid=4958183771173060125" target="_blank">SQLObject </a>是一个流行的Python 数据库对象映射框架,映射的规则就是表->类、字段->属性</p> <p>示例代码:</p> <pre class="brush:sql; toolbar: true; auto-links: false;">>>> from sqlobject import * >>> >>> sqlhub.processConnection = connectionForURI('sqlite:/:memory:') >>> >>> class Person(SQLObject): ... fname = StringCol() ... mi = StringCol(length=1, default=None) ... lname = StringCol() ... >>> Person.createTable()</pre> <p></p> <p>SQLObject 1.3.1 发布,该版本修复了 PostgreSQL 相关的一些小bug:</p> <ul> <li>VIEWs don't have PRIMARY KEYs; </li> <li>sqlmeta.idName is used as the key. </li> <li>It fixes a bug in cache handling while unpickling.</li> </ul> <p></p>