Skip to content

Commit 80b7c16

Browse files
committed
minor edit in comment
1 parent 34bd87c commit 80b7c16

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mongoengine/document.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,6 @@ def list_indexes(cls):
938938
classes = []
939939

940940
def get_classes(cls):
941-
942941
if cls not in classes and isinstance(cls, TopLevelDocumentMetaclass):
943942
classes.append(cls)
944943

@@ -965,7 +964,7 @@ def get_classes(cls):
965964

966965
get_classes(cls)
967966

968-
# get the indexes spec for all of the gathered classes
967+
# get the indexes spec for all the gathered classes
969968
def get_indexes_spec(cls):
970969
indexes = []
971970

@@ -1000,8 +999,10 @@ def compare_indexes(cls):
1000999
required = cls.list_indexes()
10011000

10021001
existing = []
1003-
for info in cls._get_collection().index_information().values():
1002+
collection = cls._get_collection()
1003+
for info in collection.index_information().values():
10041004
if "_fts" in info["key"][0]:
1005+
# Useful for text indexes (but not only)
10051006
index_type = info["key"][0][1]
10061007
text_index_fields = info.get("weights").keys()
10071008
existing.append([(key, index_type) for key in text_index_fields])

0 commit comments

Comments
 (0)