Tiny Python ORM for MySQL.
Latest version: v0.4.1
Development status: 3 - Alpha
Only support C, U, R, D, responsing to its name:
-
Create
-
Update
-
Read
-
Delete
NOTE: CURD.py may not be stable before version v1.0
>>> from models import User
>>> user = User(name='Tom', email='[email protected]')
>>> user.save() # insert
1L
>>> user.email = '[email protected]'
>>> user.save() # update
1L
>>> [user.name for user in User.select()] # select
[u'Tom']
>>> query = User.where(name='Tom').delete()
>>> query.execute() # delete
1L
>>> user = User.create(name='Kate', email='[email protected]') # another insert
>>> user.data
{'email': '[email protected]', 'name': 'Kate', 'id': 2L}
>>> user.destroy() # another delete
1L
More examples: docs/sample/.
$ pip install CURD.py
-
English version: http://curdpy.readthedocs.org/
Strongly recommend that you read Quick Start at first.
-
简体中文文档: http://curdpy-zh.readthedocs.org/
强烈建议首先阅读Quick Start.
A simple message board built with CURD.py and Flask: examples/messageboard