(self, document)
| 2614 | return super().validate(value) |
| 2615 | |
| 2616 | def to_mongo(self, document): |
| 2617 | if document is None: |
| 2618 | return None |
| 2619 | |
| 2620 | if isinstance(document, LazyReference): |
| 2621 | return SON( |
| 2622 | ( |
| 2623 | ("_cls", document.document_type._class_name), |
| 2624 | ( |
| 2625 | "_ref", |
| 2626 | DBRef( |
| 2627 | document.document_type._get_collection_name(), document.pk |
| 2628 | ), |
| 2629 | ), |
| 2630 | ) |
| 2631 | ) |
| 2632 | else: |
| 2633 | return super().to_mongo(document) |
| 2634 | |
| 2635 | |
| 2636 | class Decimal128Field(BaseField): |
nothing calls this directly
no test coverage detected