(cls: Type[_O])
| 216 | |
| 217 | |
| 218 | def _dive_for_cls_manager(cls: Type[_O]) -> Optional[ClassManager[_O]]: |
| 219 | # because the class manager registration is pluggable, |
| 220 | # we need to do the search for every class in the hierarchy, |
| 221 | # rather than just a simple "cls._sa_class_manager" |
| 222 | |
| 223 | for base in cls.__mro__: |
| 224 | manager: Optional[ClassManager[_O]] = attributes.opt_manager_of_class( |
| 225 | base |
| 226 | ) |
| 227 | if manager: |
| 228 | return manager |
| 229 | return None |
| 230 | |
| 231 | |
| 232 | @util.preload_module("sqlalchemy.orm.decl_api") |
no test coverage detected