joshmarshall/mogo — pull request #18 by jellonek (2013-02-25 09:58:05+00:00)
Title: Support for caching Database objects.

* Added _db_cache support, for caching Database object, for
support of add_son_manipulator purpose.

Without this patch - every call to Connection.get_database returned new instance of pymongo.database.Database. Because of that - .add_son_manipulator on such instance was useless.

After this patch - after connecting, You can add son_manipulator to db object (or many of them) once on start (this db object will be persistent through calls to get_database). son_manipulator then will be accessible through whole session.