Add an individual MapperProperty to this mapper. If the mapper has not been configured yet, just adds the property to the initial properties dictionary sent to the constructor. If this Mapper has already been configured, then the given MapperProperty is configured i
(
self, key: str, prop: Union[Column[Any], MapperProperty[Any]]
)
| 2369 | self.add_property(key, value) |
| 2370 | |
| 2371 | def add_property( |
| 2372 | self, key: str, prop: Union[Column[Any], MapperProperty[Any]] |
| 2373 | ) -> None: |
| 2374 | """Add an individual MapperProperty to this mapper. |
| 2375 | |
| 2376 | If the mapper has not been configured yet, just adds the |
| 2377 | property to the initial properties dictionary sent to the |
| 2378 | constructor. If this Mapper has already been configured, then |
| 2379 | the given MapperProperty is configured immediately. |
| 2380 | |
| 2381 | """ |
| 2382 | prop = self._configure_property( |
| 2383 | key, prop, init=self.configured, warn_for_existing=True |
| 2384 | ) |
| 2385 | assert isinstance(prop, MapperProperty) |
| 2386 | self._init_properties[key] = prop |
| 2387 | |
| 2388 | def _expire_memoizations(self) -> None: |
| 2389 | for mapper in self.iterate_to_root(): |