(
self, key: str, mapped_class: _O, aliased_insp: AliasedInsp[_O]
)
| 802 | return attr |
| 803 | |
| 804 | def _get_from_serialized( |
| 805 | self, key: str, mapped_class: _O, aliased_insp: AliasedInsp[_O] |
| 806 | ) -> Any: |
| 807 | # this method is only used in terms of the |
| 808 | # sqlalchemy.ext.serializer extension |
| 809 | attr = getattr(mapped_class, key) |
| 810 | if hasattr(attr, "__call__") and hasattr(attr, "__self__"): |
| 811 | return types.MethodType(attr.__func__, self) |
| 812 | |
| 813 | # attribute is a descriptor, that will be invoked against a |
| 814 | # "self"; so invoke the descriptor against this self |
| 815 | if hasattr(attr, "__get__"): |
| 816 | attr = attr.__get__(None, self) |
| 817 | |
| 818 | # attributes within the QueryableAttribute system will want this |
| 819 | # to be invoked so the object can be adapted |
| 820 | if hasattr(attr, "adapt_to_entity"): |
| 821 | aliased_insp._weak_entity = weakref.ref(self) |
| 822 | attr = attr.adapt_to_entity(aliased_insp) |
| 823 | setattr(self, key, attr) |
| 824 | |
| 825 | return attr |
| 826 | |
| 827 | def __repr__(self) -> str: |
| 828 | return "<AliasedClass at 0x%x; %s>" % ( |
no test coverage detected