MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / includes_cls

Function includes_cls

mongoengine/document.py:49–57  ·  view source on GitHub ↗

Helper function used for ensuring and comparing indexes.

(fields)

Source from the content-addressed store, hash-verified

47
48
49def includes_cls(fields):
50 """Helper function used for ensuring and comparing indexes."""
51 first_field = None
52 if len(fields):
53 if isinstance(fields[0], str):
54 first_field = fields[0]
55 elif isinstance(fields[0], (list, tuple)) and len(fields[0]):
56 first_field = fields[0][0]
57 return first_field == "_cls"
58
59
60class InvalidCollectionError(Exception):

Callers 2

ensure_indexesMethod · 0.85
compare_indexesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected