(self)
| 726 | |
| 727 | @property |
| 728 | def document_type(self): |
| 729 | if isinstance(self.document_type_obj, str): |
| 730 | if self.document_type_obj == RECURSIVE_REFERENCE_CONSTANT: |
| 731 | resolved_document_type = self.owner_document |
| 732 | else: |
| 733 | resolved_document_type = get_document(self.document_type_obj) |
| 734 | |
| 735 | if not issubclass(resolved_document_type, EmbeddedDocument): |
| 736 | # Due to the late resolution of the document_type |
| 737 | # There is a chance that it won't be an EmbeddedDocument (#1661) |
| 738 | self.error( |
| 739 | "Invalid embedded document class provided to an " |
| 740 | "EmbeddedDocumentField" |
| 741 | ) |
| 742 | self.document_type_obj = resolved_document_type |
| 743 | |
| 744 | return self.document_type_obj |
| 745 | |
| 746 | def to_python(self, value): |
| 747 | if not isinstance(value, self.document_type): |
nothing calls this directly
no test coverage detected