organizations-local 0.0.51__tar.gz → 0.0.53__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.
- {organizations_local-0.0.51 → organizations_local-0.0.53}/PKG-INFO +1 -1
- organizations_local-0.0.53/organizations_local/src/organizations_constants.py +19 -0
- {organizations_local-0.0.51 → organizations_local-0.0.53}/organizations_local/src/organizations_local.py +19 -42
- {organizations_local-0.0.51 → organizations_local-0.0.53}/organizations_local.egg-info/PKG-INFO +1 -1
- {organizations_local-0.0.51 → organizations_local-0.0.53}/setup.py +8 -8
- organizations_local-0.0.51/organizations_local/src/organizations_constants.py +0 -19
- {organizations_local-0.0.51 → organizations_local-0.0.53}/README.md +0 -0
- {organizations_local-0.0.51 → organizations_local-0.0.53}/organizations_local/src/__init__.py +0 -0
- {organizations_local-0.0.51 → organizations_local-0.0.53}/organizations_local.egg-info/SOURCES.txt +0 -0
- {organizations_local-0.0.51 → organizations_local-0.0.53}/organizations_local.egg-info/dependency_links.txt +0 -0
- {organizations_local-0.0.51 → organizations_local-0.0.53}/organizations_local.egg-info/requires.txt +0 -0
- {organizations_local-0.0.51 → organizations_local-0.0.53}/organizations_local.egg-info/top_level.txt +0 -0
- {organizations_local-0.0.51 → organizations_local-0.0.53}/pyproject.toml +0 -0
- {organizations_local-0.0.51 → organizations_local-0.0.53}/setup.cfg +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from logger_local.LoggerComponentEnum import LoggerComponentEnum
|
|
2
|
+
|
|
3
|
+
ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID = 286
|
|
4
|
+
ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME = "organization-local-python-package"
|
|
5
|
+
DEVELOPER_EMAIL = "tal.g@circ.zone"
|
|
6
|
+
ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT = {
|
|
7
|
+
'component_id': ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID,
|
|
8
|
+
'component_name': ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME,
|
|
9
|
+
'component_category': LoggerComponentEnum.ComponentCategory.Code.value,
|
|
10
|
+
'developer_email': DEVELOPER_EMAIL
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
ORGANIZATIONS_PYTHON_PACKAGE_TEST_LOGGER_OBJECT = {
|
|
14
|
+
'component_id': ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID,
|
|
15
|
+
'component_name': ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME,
|
|
16
|
+
'component_category': LoggerComponentEnum.ComponentCategory.Unit_Test.value,
|
|
17
|
+
'testing_framework': LoggerComponentEnum.testingFramework.pytest.value,
|
|
18
|
+
'developer_email': DEVELOPER_EMAIL
|
|
19
|
+
}
|
|
@@ -57,19 +57,13 @@ DEFAULT_NOT_DELETED_ML_VIEW_NAME = "organization_ml_not_deleted_view"
|
|
|
57
57
|
# "description"
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
class OrganizationsLocal(
|
|
61
|
-
|
|
62
|
-
metaclass=MetaLogger,
|
|
63
|
-
object=ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT,
|
|
64
|
-
):
|
|
60
|
+
class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
|
|
61
|
+
object=ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT):
|
|
65
62
|
def __init__(self, is_test_data=False) -> None:
|
|
66
|
-
GenericCRUDML.__init__(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
default_column_name=DEFAULT_ID_COLUMN_NAME,
|
|
71
|
-
is_test_data=is_test_data,
|
|
72
|
-
)
|
|
63
|
+
GenericCRUDML.__init__(self, default_schema_name=DEFAULT_SCHEMA_NAME,
|
|
64
|
+
default_table_name=DEFAULT_TABLE_NAME,
|
|
65
|
+
default_column_name=DEFAULT_ID_COLUMN_NAME,
|
|
66
|
+
is_test_data=is_test_data)
|
|
73
67
|
self.default_view_table_name = DEFAULT_VIEW_NAME
|
|
74
68
|
|
|
75
69
|
@staticmethod
|
|
@@ -84,14 +78,8 @@ class OrganizationsLocal(
|
|
|
84
78
|
|
|
85
79
|
@staticmethod
|
|
86
80
|
def _clean_organization_ml_dict(organization_dict: dict) -> dict:
|
|
87
|
-
columns = (
|
|
88
|
-
|
|
89
|
-
"is_main",
|
|
90
|
-
"title",
|
|
91
|
-
"is_title_approved",
|
|
92
|
-
"is_description_approved",
|
|
93
|
-
"description",
|
|
94
|
-
)
|
|
81
|
+
columns = ("lang_code", "is_main", "title", "is_title_approved",
|
|
82
|
+
"is_description_approved", "description")
|
|
95
83
|
organization_ml_dict = {key: organization_dict.get(key) for key in columns}
|
|
96
84
|
return organization_ml_dict
|
|
97
85
|
|
|
@@ -145,14 +133,12 @@ class OrganizationsLocal(
|
|
|
145
133
|
# TODO upsert_result_dict
|
|
146
134
|
upsert_information = {
|
|
147
135
|
"organization_id": organization_id,
|
|
148
|
-
"organization_ml_ids_list": organzation_ml_ids_list
|
|
136
|
+
"organization_ml_ids_list": organzation_ml_ids_list
|
|
149
137
|
}
|
|
150
138
|
|
|
151
139
|
return upsert_information
|
|
152
140
|
|
|
153
|
-
def update_organization(
|
|
154
|
-
self, *, organization_id: int, organization_ml_id: int, organization_dict: dict
|
|
155
|
-
) -> None:
|
|
141
|
+
def update_organization(self, *, organization_id: int, organization_ml_id: int, organization_dict: dict) -> None:
|
|
156
142
|
# TODO: should we have such a method in CRUD ML? Same for delete
|
|
157
143
|
organization_ml_dict = self._clean_organization_ml_dict(
|
|
158
144
|
organization_dict)
|
|
@@ -178,9 +164,7 @@ class OrganizationsLocal(
|
|
|
178
164
|
column_name="organization_ml_id")
|
|
179
165
|
organization_dict = self.select_one_dict_by_column_and_value(
|
|
180
166
|
view_table_name=view_table_name,
|
|
181
|
-
column_value=organization_id,
|
|
182
|
-
column_name="organization_id",
|
|
183
|
-
)
|
|
167
|
+
column_value=organization_id, column_name="organization_id")
|
|
184
168
|
|
|
185
169
|
return {**organization_dict, **organization_ml_dict}
|
|
186
170
|
|
|
@@ -219,7 +203,7 @@ class OrganizationsLocal(
|
|
|
219
203
|
view_table_name = view_table_name or DEFAULT_ML_VIEW_NAME
|
|
220
204
|
organizations_ids_and_names_list = []
|
|
221
205
|
select_clause_value = "organization_id, title"
|
|
222
|
-
placeholders =
|
|
206
|
+
placeholders = ', '.join(['%s'] * len(organizations_ids_list))
|
|
223
207
|
where_clause_value = f"organization_id in ({placeholders})"
|
|
224
208
|
organizations_ids_and_names_list = self.select_multi_tuple_by_where(
|
|
225
209
|
view_table_name=view_table_name,
|
|
@@ -251,11 +235,9 @@ class OrganizationsLocal(
|
|
|
251
235
|
# Was def get_update_status(self, *, last_modified_timestamp: str, main_profile_id: int) -> UpdateStatus:
|
|
252
236
|
def get_update_status_and_information_list(self, *,
|
|
253
237
|
last_modified_timestamp: str,
|
|
254
|
-
main_profile_id: int
|
|
238
|
+
main_profile_id: int or None) -> list[dict]:
|
|
255
239
|
if main_profile_id is None:
|
|
256
|
-
update_status_and_information_list = [
|
|
257
|
-
{"update_status": UpdateStatus.UPDATE_CIRCLEZ}
|
|
258
|
-
]
|
|
240
|
+
update_status_and_information_list = [{"update_status": UpdateStatus.UPDATE_CIRCLEZ}]
|
|
259
241
|
return update_status_and_information_list
|
|
260
242
|
sync_conflict_resolution = SyncConflictResolution()
|
|
261
243
|
# TODO: Shall we also check update_timestamp in organization_table to see if the name was changed?
|
|
@@ -274,17 +256,12 @@ class OrganizationsLocal(
|
|
|
274
256
|
if organization_id is not None:
|
|
275
257
|
organizations_ids_list.append(organization_id)
|
|
276
258
|
|
|
277
|
-
organizations_ids_and_names_list = (
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
view_table_name="organization_ml_view",
|
|
281
|
-
)
|
|
282
|
-
)
|
|
259
|
+
organizations_ids_and_names_list = self.get_organizations_ids_and_names_list_by_organizations_ids(
|
|
260
|
+
organizations_ids_list=organizations_ids_list,
|
|
261
|
+
view_table_name="organization_ml_view")
|
|
283
262
|
|
|
284
263
|
# Convert organizations_ids_and_names_list to a dictionary
|
|
285
|
-
organizations_ids_and_names_dict = {
|
|
286
|
-
item[0]: item[1] for item in organizations_ids_and_names_list
|
|
287
|
-
}
|
|
264
|
+
organizations_ids_and_names_dict = {item[0]: item[1] for item in organizations_ids_and_names_list}
|
|
288
265
|
|
|
289
266
|
for update_status_and_information in update_status_and_information_list:
|
|
290
267
|
organization_id = update_status_and_information.get("organization_id")
|
|
@@ -293,7 +270,7 @@ class OrganizationsLocal(
|
|
|
293
270
|
|
|
294
271
|
return update_status_and_information_list
|
|
295
272
|
|
|
296
|
-
def get_organization_name_by_organization_identifier(self, organization_identifier: str) -> str
|
|
273
|
+
def get_organization_name_by_organization_identifier(self, organization_identifier: str) -> str or None:
|
|
297
274
|
organization_name = self.select_one_value_by_column_and_value(
|
|
298
275
|
select_clause_value="name",
|
|
299
276
|
schema_name="organization",
|
|
@@ -5,25 +5,25 @@ package_dir = PACKAGE_NAME.replace("-", "_")
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name=PACKAGE_NAME,
|
|
8
|
-
version='0.0.
|
|
8
|
+
version='0.0.53', # https://pypi.org/project/organizations-local/
|
|
9
9
|
author="Circles",
|
|
10
10
|
author_email="info@circlez.ai",
|
|
11
11
|
description="PyPI Package for Circles organizations-local Python",
|
|
12
12
|
long_description="PyPI Package for Circles organizations-local Python",
|
|
13
|
-
long_description_content_type=
|
|
13
|
+
long_description_content_type='text/markdown',
|
|
14
14
|
url=f"https://github.com/circles-zone/{PACKAGE_NAME}-python-package",
|
|
15
15
|
packages=[package_dir],
|
|
16
|
-
package_dir={package_dir: f
|
|
17
|
-
package_data={package_dir: [
|
|
16
|
+
package_dir={package_dir: f'{package_dir}/src'},
|
|
17
|
+
package_data={package_dir: ['*.py']},
|
|
18
18
|
classifiers=[
|
|
19
19
|
"Programming Language :: Python :: 3",
|
|
20
20
|
# "License :: Other/Proprietary License",
|
|
21
21
|
"Operating System :: OS Independent",
|
|
22
22
|
],
|
|
23
23
|
install_requires=[
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
'database-mysql-local>=0.0.290',
|
|
25
|
+
'language-remote>=0.0.20',
|
|
26
|
+
'location-local>=0.0.8',
|
|
27
|
+
'user-context-remote>=0.0.58',
|
|
28
28
|
],
|
|
29
29
|
)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from logger_local.LoggerComponentEnum import LoggerComponentEnum
|
|
2
|
-
|
|
3
|
-
ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID = 286
|
|
4
|
-
ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME = "organization-local-python-package"
|
|
5
|
-
DEVELOPER_EMAIL = "tal.g@circ.zone"
|
|
6
|
-
ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT = {
|
|
7
|
-
"component_id": ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID,
|
|
8
|
-
"component_name": ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME,
|
|
9
|
-
"component_category": LoggerComponentEnum.ComponentCategory.Code.value,
|
|
10
|
-
"developer_email": DEVELOPER_EMAIL,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
ORGANIZATIONS_PYTHON_PACKAGE_TEST_LOGGER_OBJECT = {
|
|
14
|
-
"component_id": ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID,
|
|
15
|
-
"component_name": ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME,
|
|
16
|
-
"component_category": LoggerComponentEnum.ComponentCategory.Unit_Test.value,
|
|
17
|
-
"testing_framework": LoggerComponentEnum.testingFramework.pytest.value,
|
|
18
|
-
"developer_email": DEVELOPER_EMAIL,
|
|
19
|
-
}
|
|
File without changes
|
{organizations_local-0.0.51 → organizations_local-0.0.53}/organizations_local/src/__init__.py
RENAMED
|
File without changes
|
{organizations_local-0.0.51 → organizations_local-0.0.53}/organizations_local.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{organizations_local-0.0.51 → organizations_local-0.0.53}/organizations_local.egg-info/requires.txt
RENAMED
|
File without changes
|
{organizations_local-0.0.51 → organizations_local-0.0.53}/organizations_local.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|