Python ORM 框架 Quick ORM
fmms
13年前
Quick ORM 是一个 Python 的 ORM 框架。超级简单的安装和配置,可以一分钟上手!
Hello World 示例from quick_orm.core import Database from sqlalchemy import Column, String __metaclass__ = Database.DefaultMeta class User: name = Column(String(30)) Database.register() if __name__ == '__main__': db = Database('sqlite://') db.create_tables() user = User(name = 'Hello World') db.session.add_then_commit(user) user = db.session.query(User).get(1) print 'My name is', user.name