Package: nosqlalchemy
nosqlalchemyusage:from nosqlalchemy import (Collection,Key,ListCollection,MongoDBInterface,MongoSession,SubCollection,)class SampleSubCollection(SubCollection):__name__ = 'sample_sub_collection'sub_key1 = Key()sub_key2 = Key()class SampleListCollection(ListCollection):__name__ = 'sample_list_collection'__list_element_type__ = int  # base collection is set to object# do not override to store any object type# in the listclass SampleCollection(Collection):__name__ = 'sample'__database__ = 'test'__primary_key__ = 'key1'  # declares a unique value as unique within the# collection.key1 = Key()key2 = Key()sub_collection = SampleSubCollection()list_collection = SampleListCollection()mdi = MongoDBInterface() # args host='host', port='27017'MSession = MongoSession(mdi)sample_collection = SampleCollection()sample_collection.key1 = 'key1'sample_collection.key2 = 2sample_collection.sub_collection.sub_key1 = 'sub_key1'sample_collection.sub_collection.sub_key2 = 2sample_collection.list_collection.append(1)sample_collection.list_collection = 2print sample_collectionprint type(MSession.add(sample_collection))col = MSession.query(SampleCollection).find_one({'sub_collection.sub_key2': 2})print colMSession.drop_all(SampleCollection)Test:coverage run --include=nosqlalchemy/__init__.py,nosqlalchemy/nosql.py --omit=nosqlalchemy/tests setup.py testtest_bulk_remove (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_lazy_collection (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_list_collection (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_mongo_create (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_mongo_get (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_mongo_misc (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_mongo_query (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_mongo_remove (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_mongo_update (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_object_id_property (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_raw_mdi (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_sub_collection (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... oktest_sub_collection_list (nosqlalchemy.tests.nosqlalchemy_test.TestNoSQL) ... ok----------------------------------------------------------------------Ran 13 tests in 0.039sOKcoverage report -mName                    Stmts   Miss  Cover   Missing-----------------------------------------------------nosqlalchemy/__init__       1      0   100%nosqlalchemy/nosql        207     10    95%   44, 179-187, 278, 283, 304-----------------------------------------------------TOTAL                     208     10    95%commit ed63d179cbabd504714072d5a9928aea3a5e62d0Author: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Thu Aug 1 00:37:24 2013 -0500LazyCollection fixescommit 11319759a2888d1a0c75d0d568fe214c32b79d8aAuthor: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Mon Jul 29 17:42:38 2013 -0500Adding LazyCollections testcommit dc69acfc910d10c8677121993a8ad1912ea7ff07Author: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Mon Jul 29 17:42:16 2013 -0500Adding LazyCollectionscommit 5f6b5a2b22be3f9d67dfa23fac39c0e8f843fce5Author: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Tue Jul 9 15:48:34 2013 -0500fix class variable collisionscommit 17d0d5cb59388bfad5a6f9bdb0aceb35eb78d3adAuthor: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Tue Jul 9 15:47:51 2013 -0500Reverse order of refernce for more robust testingcommit 9de5592e07196102ccbbff3f5c149ed601417f11Author: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Fri Jun 14 18:50:16 2013 -0500instansiate empty subcollections and listcollections on initcommit 85a64eb869ab6006c8c1c22caff7bbd81997b5cfAuthor: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Fri Jun 14 17:55:19 2013 -0500return the oid on savecommit 567d66c16bec355128f607857e0f9cbafb12a183Author: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Fri Jun 14 14:46:20 2013 -0500add remove() method to query object for bulk removalcommit 9bdc3c0e57d1b277bb5a2af84cc4fd3585ed385eAuthor: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Tue May 28 09:32:52 2013 -0500Update changelogcommit 3f0fdfc871e3fd55e57999e45567bdb372c0bc8cAuthor: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Tue May 28 09:32:01 2013 -0500remove unneeded assignmentcommit a9328a037100e095eea14c376f004d6558191bc7Author: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Tue May 28 09:28:05 2013 -0500Changescommit 82bab92adebcb452b832a1166990602d8d65d47eAuthor: Jared Rodriguez <jared.rodriguez@rackspace.com>Date:   Sun May 26 14:45:43 2013 -0500Creating a python package and adding testsAdded SubCollection and ListCollection supportcommit 259a066cfcb974984c959c26bd0f6ea5139f8343Author: Jared Rodriguez <jrod@blacknode.net>Date:   Fri Jan 6 18:16:01 2012 -0600fux0rscommit 67e6a57f3a123aacabf1ced020ab1a5606aa69bfAuthor: Jared Rodriguez <jrod@blacknode.net>Date:   Thu Dec 15 21:10:42 2011 -0600first commit