(self, value, clean=True)
| 812 | return value |
| 813 | |
| 814 | def validate(self, value, clean=True): |
| 815 | if self.choices and isinstance(value, SON): |
| 816 | for choice in self.choices: |
| 817 | if value["_cls"] == choice._class_name: |
| 818 | return True |
| 819 | |
| 820 | if not isinstance(value, EmbeddedDocument): |
| 821 | self.error( |
| 822 | "Invalid embedded document instance provided to an " |
| 823 | "GenericEmbeddedDocumentField" |
| 824 | ) |
| 825 | |
| 826 | value.validate(clean=clean) |
| 827 | |
| 828 | def lookup_member(self, member_name): |
| 829 | document_choices = self.choices or [] |