Overview
The connection module is not intended to be part of the public API for django-audit, but you may find it helpful if you want to perform some custom work on the auditing collection as such just the API documentation is included here.
A wrapper around PyMongo’s connection to MongoDB
Make the connection to MongoDB.
Retrieve the default database based on Django settings.
Initially a lookup is performed and thereafter the cached database is returned.
| Return type: | <pending_xref py:class=”MongoConnection” py:module=”djangoaudit.connection” refdoc=”connection” refdomain=”py” refexplicit=”False” reftarget=”pymongo.database.Database” reftype=”class”><literal classes=”xref py py-class”>pymongo.database.Database</literal></pending_xref> |
|---|
Get the collection specified by collection_name
| Parameters: |
|
|---|---|
| Return type: | <pending_xref py:class=”MongoConnection” py:module=”djangoaudit.connection” refdoc=”connection” refdomain=”py” refexplicit=”False” reftarget=”pymongo.collection.Collection” reftype=”class”><literal classes=”xref py py-class”>pymongo.collection.Collection</literal></pending_xref> |
This module level variable should be the only thing that is imported as it sets up the connection to MongoDB based on the django settings.