SQLObject 1.2.0 发布,Python 的 ORM 框架

发布于 2011年11月21日
收藏 3

SQLObject 1.2.0 发布了,该版本主要改进包括:

  • Strings are treated specially in Select to allow Select(['id, 'name'], where='value = 42').
  • ForeignKey('Table', refColumn='refcol_id') allows ForeignKey to point to a non-id column.
  • Support for PostgreSQL 7.* is dropped; the minimal supported version of PostgreSQL is 8.1.
  • Quoting rules have changed for PostgreSQL: SQLObject uses the E'' escape string.
  • A bug caused by psycopg2 recently adding a new Boolean non-callable autocommit attribute was fixed.
  • sqlobject.__doc__ and main.__doc__ no longer contain the version number: use sqlobject.version or version_info

SQLObject 是一个流行的Python 数据库对象映射框架,映射的规则就是表->类、字段->属性


>>> from sqlobject import *
>>> sqlhub.processConnection = connectionForURI('sqlite:/:memory:')
>>> class Person(SQLObject):
... fname = StringCol()
... mi = StringCol(length=1, default=None)
... lname = StringCol()
>>> Person.createTable()
转载请注明:文章转载自 OSCHINA 社区 [http://www.oschina.net]
本文标题:SQLObject 1.2.0 发布,Python 的 ORM 框架