Convert a MongoDB-compatible type to a Python type.
(self, value)
| 1244 | return id_ |
| 1245 | |
| 1246 | def to_python(self, value): |
| 1247 | """Convert a MongoDB-compatible type to a Python type.""" |
| 1248 | if not self.dbref and not isinstance( |
| 1249 | value, (DBRef, Document, EmbeddedDocument) |
| 1250 | ): |
| 1251 | collection = self.document_type._get_collection_name() |
| 1252 | value = DBRef(collection, self.document_type.id.to_python(value)) |
| 1253 | return value |
| 1254 | |
| 1255 | def prepare_query_value(self, op, value): |
| 1256 | if value is None: |
nothing calls this directly
no test coverage detected