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

Method validate

mongoengine/fields.py:2608–2614  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

2606 return super().__get__(instance, owner)
2607
2608 def validate(self, value):
2609 if isinstance(value, LazyReference) and value.pk is None:
2610 self.error(
2611 "You can only reference documents once they have been"
2612 " saved to the database"
2613 )
2614 return super().validate(value)
2615
2616 def to_mongo(self, document):
2617 if document is None:

Callers

nothing calls this directly

Calls 2

errorMethod · 0.80
validateMethod · 0.45

Tested by

no test coverage detected