konecty-sdk-python 1.2.1__tar.gz → 1.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/settings.py +24 -4
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/PKG-INFO +1 -1
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/pyproject.toml +1 -1
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/.gitignore +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/__init__.py +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/cli/__init__.py +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/cli/apply.py +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/cli/backup.py +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/cli/pull.py +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/__init__.py +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/client.py +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/file_manager.py +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/filters.py +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/model.py +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/types.py +0 -0
- {konecty_sdk_python-1.2.1 → konecty_sdk_python-1.2.2}/README.md +0 -0
|
@@ -60,9 +60,15 @@ async def fill_settings(settings_class: Type[T]) -> T:
|
|
|
60
60
|
|
|
61
61
|
# Primeiro verifica variáveis de ambiente e coleta campos que precisam ser buscados no Konecty
|
|
62
62
|
for field_name in settings_class.model_fields.keys():
|
|
63
|
-
|
|
63
|
+
field = settings_class.model_fields[field_name]
|
|
64
|
+
field_str = (
|
|
65
|
+
field.validation_alias
|
|
66
|
+
if field.validation_alias
|
|
67
|
+
else field.alias if field.alias else field_name
|
|
68
|
+
)
|
|
69
|
+
env_value = os.getenv(field_str.upper())
|
|
64
70
|
if env_value is not None and env_value.strip():
|
|
65
|
-
field_type =
|
|
71
|
+
field_type = field.annotation
|
|
66
72
|
converted_value = _convert_value(env_value, field_type)
|
|
67
73
|
if converted_value is not None:
|
|
68
74
|
settings_dict[field_name] = converted_value
|
|
@@ -76,9 +82,15 @@ async def fill_settings(settings_class: Type[T]) -> T:
|
|
|
76
82
|
)
|
|
77
83
|
|
|
78
84
|
for field_name in settings_class.model_fields.keys():
|
|
79
|
-
|
|
85
|
+
field = settings_class.model_fields[field_name]
|
|
86
|
+
field_str = (
|
|
87
|
+
field.validation_alias
|
|
88
|
+
if field.validation_alias
|
|
89
|
+
else field.alias if field.alias else field_name
|
|
90
|
+
)
|
|
91
|
+
value = konecty_settings.get(field_str.upper())
|
|
80
92
|
if value is not None and value.strip():
|
|
81
|
-
field_type =
|
|
93
|
+
field_type = field.annotation
|
|
82
94
|
converted_value = _convert_value(value, field_type)
|
|
83
95
|
if converted_value is not None:
|
|
84
96
|
settings_dict[field_name] = converted_value
|
|
@@ -130,3 +142,11 @@ def fill_settings_sync(settings_class: Type[T]) -> T:
|
|
|
130
142
|
settings_dict[field_name] = converted_value
|
|
131
143
|
|
|
132
144
|
return settings_class.model_construct(**settings_dict)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def get_field_name(field) -> str:
|
|
148
|
+
return (
|
|
149
|
+
field.validation_alias
|
|
150
|
+
if field.validation_alias
|
|
151
|
+
else field.alias if field.alias else field.name
|
|
152
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|