File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ])
You can’t perform that action at this time.
0 commit comments