konecty-sdk-python 1.2.0__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.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/settings.py +27 -5
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/PKG-INFO +1 -1
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/pyproject.toml +1 -1
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/.gitignore +0 -0
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/__init__.py +0 -0
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/cli/__init__.py +0 -0
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/cli/apply.py +0 -0
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/cli/backup.py +0 -0
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/cli/pull.py +0 -0
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/__init__.py +0 -0
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/client.py +0 -0
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/file_manager.py +0 -0
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/filters.py +0 -0
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/model.py +0 -0
- {konecty_sdk_python-1.2.0 → konecty_sdk_python-1.2.2}/KonectySdkPython/lib/types.py +0 -0
- {konecty_sdk_python-1.2.0 → 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
|
|
@@ -75,9 +81,16 @@ async def fill_settings(settings_class: Type[T]) -> T:
|
|
|
75
81
|
[field.upper() for field in fields_to_fetch]
|
|
76
82
|
)
|
|
77
83
|
|
|
78
|
-
for field_name
|
|
84
|
+
for field_name in settings_class.model_fields.keys():
|
|
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())
|
|
79
92
|
if value is not None and value.strip():
|
|
80
|
-
field_type =
|
|
93
|
+
field_type = field.annotation
|
|
81
94
|
converted_value = _convert_value(value, field_type)
|
|
82
95
|
if converted_value is not None:
|
|
83
96
|
settings_dict[field_name] = converted_value
|
|
@@ -120,7 +133,8 @@ def fill_settings_sync(settings_class: Type[T]) -> T:
|
|
|
120
133
|
[field.upper() for field in fields_to_fetch]
|
|
121
134
|
)
|
|
122
135
|
|
|
123
|
-
for field_name
|
|
136
|
+
for field_name in settings_class.model_fields.keys():
|
|
137
|
+
value = konecty_settings.get(field_name.upper())
|
|
124
138
|
if value is not None and value.strip():
|
|
125
139
|
field_type = settings_class.model_fields[field_name].annotation
|
|
126
140
|
converted_value = _convert_value(value, field_type)
|
|
@@ -128,3 +142,11 @@ def fill_settings_sync(settings_class: Type[T]) -> T:
|
|
|
128
142
|
settings_dict[field_name] = converted_value
|
|
129
143
|
|
|
130
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
|