Skip to main content

Mongodb model helpers

Project description

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

Notes

  • Collection-level operations are accessible though the .collection, eg. MyModel.collection.find_one(). It’s verbose, but explicit is better than implicit.
  • All documents returned by raw will be instantiated as models. To get the raw json, use raw(), eg. MyModel.collection.raw().find_one().
  • Document-level operations are ported down directly to the model, eg. m = MyModel(); m.save().
  • You can’t access top-level document keys though dot notation on the models after they’ve been retrieved from the database. urmurmurm.
  • There is no model-level update, since it clashes with dict’s update. Use save, or Model.collection.update(instance, …).
  • The model-level remove is restricted to only remove the model’s document.
  • No special ref support… yet.
  • Tests are desperately lacking. Help!

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.1rc2
Filename, size File type Python version Upload date Hashes
Filename, size kale-0.1rc2.tar.gz (3.4 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