Update the `FieldInfo` instance from the configuration set on the model it belongs to. This will apply the title and alias generators from the configuration. Args: config_wrapper: The configuration from the model. field_name: The field name the `FieldInfo` instance is attac
(config_wrapper: ConfigWrapper, field_name: str, field_info: FieldInfo)
| 189 | |
| 190 | |
| 191 | def update_field_from_config(config_wrapper: ConfigWrapper, field_name: str, field_info: FieldInfo) -> None: |
| 192 | """Update the `FieldInfo` instance from the configuration set on the model it belongs to. |
| 193 | |
| 194 | This will apply the title and alias generators from the configuration. |
| 195 | |
| 196 | Args: |
| 197 | config_wrapper: The configuration from the model. |
| 198 | field_name: The field name the `FieldInfo` instance is attached to. |
| 199 | field_info: The `FieldInfo` instance to update. |
| 200 | """ |
| 201 | field_title_generator = field_info.field_title_generator or config_wrapper.field_title_generator |
| 202 | if field_title_generator is not None: |
| 203 | _apply_field_title_generator_to_field_info(field_title_generator, field_name, field_info) |
| 204 | if config_wrapper.alias_generator is not None: |
| 205 | _apply_alias_generator_to_field_info(config_wrapper.alias_generator, field_name, field_info) |
| 206 | |
| 207 | |
| 208 | _deprecated_method_names = {'dict', 'json', 'copy', '_iter', '_copy_and_set_values', '_calculate_keys'} |
no test coverage detected