diff options
| author | J08nY | 2024-02-01 17:07:13 +0100 |
|---|---|---|
| committer | J08nY | 2024-02-01 17:54:24 +0100 |
| commit | 5e12aff90834e0896f15a2f86559c0abdb4cecd7 (patch) | |
| tree | 9d64012ae4f838299827a4f8bb2611874f85284f /src | |
| parent | e5de942140115f70aa08c68f594b2619779c16cc (diff) | |
| download | sec-certs-5e12aff90834e0896f15a2f86559c0abdb4cecd7.tar.gz sec-certs-5e12aff90834e0896f15a2f86559c0abdb4cecd7.tar.zst sec-certs-5e12aff90834e0896f15a2f86559c0abdb4cecd7.zip | |
Move __fields__ use to model_fields.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sec_certs/configuration.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sec_certs/configuration.py b/src/sec_certs/configuration.py index 9895fa53..81fac197 100644 --- a/src/sec_certs/configuration.py +++ b/src/sec_certs/configuration.py @@ -121,12 +121,12 @@ class Configuration(BaseSettings): """ Returns keys of the config that have non-default value, i.e. were provided as kwargs, env. vars. or additionaly set. """ - return {key for key, value in Configuration.__fields__.items() if getattr(self, key) != value.default} + return {key for key, value in Configuration.model_fields.items() if getattr(self, key) != value.default} def _set_attrs_from_cfg(self, other_cfg: Configuration, fields_to_set: set[str] | None) -> None: if not fields_to_set: - fields_to_set = set(Configuration.__fields__.keys()) - for field in [x for x in other_cfg.__fields__ if x in fields_to_set]: + fields_to_set = set(Configuration.model_fields.keys()) + for field in [x for x in other_cfg.model_fields if x in fields_to_set]: setattr(self, field, getattr(other_cfg, field)) def load_from_yaml(self, yaml_path: str | Path) -> None: |
