diff --git a/.landscape.yml b/.landscape.yml index fc03d5a2..67792743 100644 --- a/.landscape.yml +++ b/.landscape.yml @@ -1,3 +1,4 @@ pylint: disable: - - W0212 + # We use this a lot (e.g. via document._meta) + - protected-access diff --git a/mongoengine/document.py b/mongoengine/document.py index 3ad5f655..31f3388d 100644 --- a/mongoengine/document.py +++ b/mongoengine/document.py @@ -362,7 +362,7 @@ class Document(BaseDocument): else: select_dict = {} select_dict['_id'] = object_id - shard_key = self.__class__._meta.get('shard_key', tuple()) + shard_key = self._meta.get('shard_key', tuple()) for k in shard_key: path = self._lookup_field(k.split('.')) actual_key = [p.db_field for p in path]