* added flake8 and flake8-import-order to travis for py27
* fixed a test that fails from time to time depending on an order of a dict
* flake8 tweaks for the entire codebase excluding tests
If you __setitem__ in BaseList with a negative index and then try to save this, you will get an error like: OperationError: Could not save document (cannot use the part (shape of signal.shape.-1) to traverse the element ({shape: [ 0 ]})). To fix this I rectify negative list indices in BaseList _mark_as_changed as the appropriate positive index. This fixes the above error.
- Added new field type: EmbeddedDocumentListField.
- Provides additional query ability for lists of embedded documents.
- ClosesMongoEngine/mongoengine#503.
Migrate changes to include updating single elements of ListFields as
well as MapFields by adding the same changes to BaseList. This is
done by ensuring all BaseDicts and BaseLists have the correct name
from the base of the nearest (Embedded)Document, then marking changes
with their key or index when they are changed.
Tests also all fixed up.
When using nested MapFields from a document loaded from the database, the
nested dictionaries aren't converted to BaseDict, so changes aren't
marked.
This also includes a change when marking a field as changed to ensure that
nested fields aren't included in a $set query if a parent is already marked
as changed. Not sure if this could occur but it prevents breakage if it does.
The inheritance model has changed, we no longer need to store an array of
`types` with the model we can just use the classname in `_cls`.
See the upgrade docs for information on how to upgrade
MongoEngine/mongoengine#148