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

Class BlogPost

tests/document/test_indexes.py:48–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47 def _index_test(self, InheritFrom):
48 class BlogPost(InheritFrom):
49 date = DateTimeField(db_field="addDate", default=datetime.now)
50 category = StringField()
51 tags = ListField(StringField())
52 meta = {"indexes": ["-date", "tags", ("category", "-date")]}
53
54 expected_specs = [
55 {"fields": [("addDate", -1)]},

Calls 6

DateTimeFieldClass · 0.85
StringFieldClass · 0.85
ListFieldClass · 0.85
SortedListFieldClass · 0.85