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.

Source Distribution

kale-0.1rc2.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file kale-0.1rc2.tar.gz.

File metadata

  • Download URL: kale-0.1rc2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for kale-0.1rc2.tar.gz
Algorithm Hash digest
SHA256 94af338f15845b77b93d6bb9554a2edd49d63b69df0c97e451c64ba60bbcc525
MD5 dc8fae411b3c609ac09e99080ebf74e7
BLAKE2b-256 96310d3e30d651697884a0b8f54c52a433c837f61347c34749f8bdc984e554c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page