Merge branch 'master' of github.com:MongoEngine/mongoengine into release_0_19_0

This commit is contained in:
Bastien Gérard
2019-12-20 23:49:41 +01:00
6 changed files with 101 additions and 19 deletions

View File

@@ -120,6 +120,9 @@ class BaseList(list):
super(BaseList, self).__init__(list_items)
def __getitem__(self, key):
# change index to positive value because MongoDB does not support negative one
if isinstance(key, int) and key < 0:
key = len(self) + key
value = super(BaseList, self).__getitem__(key)
if isinstance(key, slice):