手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Python 的 ORM 框架 SQLObject 1.2.0 发布

[日期:2011-11-21] 来源:Linux社区  作者:Linux [字体:大 中 小]

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()

更多关于SQLObject的详细信息,或者下载地址请点这里

linux
相关资讯       SQLObject下载 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款