Skip to main content

Mongodb model helpers

Project description

A convenient superclass and some helpers for stuff you want to keep in mongodb.

Add and remove properties all you like. They’ll be there.

Built on pymongo and jsonpickle.

Install

`sh pip install kale `

hint: virtualenv is awesome.

Quickstart

`python >>> from kale import KaleModel >>> class User(KaleModel): ...     def __init__(self, username): ...             self.username = username ... >>> joe = User('joe') >>> joe.password = 'security now!' >>> joe.save() ObjectId('512d1ace360e2e3037a3d89c') >>> del joe >>> retrieved_joe = User.find_one({'username': 'joe'}) >>> retrieved_joe.__class__ <class '__main__.User'> >>> retrieved_joe.password u'security now!' >>> `

By default, kale will try to use a connection on localhost to a database called kale. To set this yourself, monkey-patch db.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for kale, version 0.0.22
Filename, size File type Python version Upload date Hashes
Filename, size kale-0.0.22.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page