Python的ORM框架Thing.zip

时间:2022-08-04 22:43:51
【文件属性】:
文件名称:Python的ORM框架Thing.zip
文件大小:9KB
文件格式:ZIP
更新时间:2022-08-04 22:43:51
开源项目 Thing 是无网不剩(lzyy)用 SQLAlchemy 核心开发的一款 Rails ActiveRecord 风格 ORM。 SQLAlchemy 是 Python 界著名 ORM 框架,地位与 Java 界 Hibernate 类似。而 Thing 不是对 SQLAlchemy 的包装,只使用了其核心部分(数据库适配器等),ORM 部分完全自行实现。这一做法使 Thing 非常小巧,核心代码不超过 300 行。 使用 Thing 的代码示例: import thing from formencode import validators class Member(thing.Thing): email = validators.Email(messages = {'noAt': u'invalid email'}) @property def answers(self): return Answer({'master': engine}).where('member_id', '=', self.id) 可以看出是典型的 Active Record 风格,对于内容型为主或其他数据库设计不复杂的应用来说,Thing 将非常适用。 标签:Thing
【文件预览】:
thing-master
----MANIFEST.in(18B)
----thing()
--------thing.py(20KB)
--------__init__.py(81B)
----setup.py(1008B)
----README.md(8KB)
----.gitignore(38B)

网友评论