All connection-related functions are now in connection.py. Created a ConnectionManager class for interacting with a collection in the database. Top-level document classes have an instance of a ConnectionManager (Document.collection). Defined a 'save' method on top-level document's that uses the collection manager's '_save_document' method to save the document to the database. Added tests for CollectionManagers -- all unit tests now require a valid connection to the database, which is set up in the tests' setUp method.
13 lines
231 B
Python
13 lines
231 B
Python
import document
|
|
from document import *
|
|
import fields
|
|
from fields import *
|
|
import connection
|
|
from connection import *
|
|
|
|
__all__ = document.__all__ + fields.__all__ + connection.__all__
|
|
|
|
__author__ = 'Harry Marr'
|
|
__version__ = '0.1'
|
|
|