(instance: Any)
| 309 | """ |
| 310 | |
| 311 | def fget(instance: Any) -> Any: |
| 312 | dict_ = attributes.instance_dict(instance) |
| 313 | state = attributes.instance_state(instance) |
| 314 | |
| 315 | if self.key not in dict_: |
| 316 | # key not present. Iterate through related |
| 317 | # attributes, retrieve their values. This |
| 318 | # ensures they all load. |
| 319 | values = [ |
| 320 | getattr(instance, key) for key in self._attribute_keys |
| 321 | ] |
| 322 | |
| 323 | if self.key not in dict_: |
| 324 | dict_[self.key] = self._construct_composite(*values) |
| 325 | state.manager.dispatch.refresh( |
| 326 | state, self._COMPOSITE_FGET, [self.key] |
| 327 | ) |
| 328 | |
| 329 | return dict_.get(self.key, None) |
| 330 | |
| 331 | def fset(instance: Any, value: Any) -> None: |
| 332 | if value is LoaderCallableStatus.DONT_SET: |
no test coverage detected