Skip to content
forked from hit9/skylark

Tiny Python ORM for MySQL (CURD.py may not be stable before version v1.0)

License

Notifications You must be signed in to change notification settings

gangsterzhou/CURD.py

 
 

Repository files navigation

CURD.py

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

Sample Code

>>> 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/.

Install

$ pip install CURD.py

Documentation

Sample App

A simple message board built with CURD.py and Flask: examples/messageboard

FAQ

Tests

License

LICENSE-BSD

Changes

CHANGES

About

Tiny Python ORM for MySQL (CURD.py may not be stable before version v1.0)

Resources

License

Stars

Watchers

Forks

Packages

No packages published