The API is similar to that of PyMongo and most of the same operations are
possible.
The FileField can be written too with put(), write() or by using the assignment
operator. All three cases are demonstrated in the tests. Metadata can be added
to a FileField by assigning keyword arguments when using put() or new_file().
The API is similar to that of PyMongo and most of the same operations are
possible.
The FileField can be written too with put(), write() or by using the assignment
operator. All three cases are demonstrated in the tests. Metadata can be added
to a FileField by assigning keyword arguments when using put() or new_file().
Although MongoDB uses _id, underscore prefixed attributes imply
private access in Python and are sometimes may not be accessed
(e.g. in the Django template language), but id should be public.
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.
Included tests for required fields (checks primary key is required
as well).
Switched from using SuperClass.__init__ to super().
Added constructor for EmbeddedDocumentField.