organizations-local 0.0.53__tar.gz → 0.0.54__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.53 → organizations_local-0.0.54}/PKG-INFO +1 -1
- organizations_local-0.0.54/organizations_local/src/organizations_constants_src.py +19 -0
- {organizations_local-0.0.53 → organizations_local-0.0.54}/organizations_local/src/organizations_local.py +43 -20
- {organizations_local-0.0.53 → organizations_local-0.0.54}/organizations_local.egg-info/PKG-INFO +1 -1
- {organizations_local-0.0.53 → organizations_local-0.0.54}/organizations_local.egg-info/SOURCES.txt +1 -1
- {organizations_local-0.0.53 → organizations_local-0.0.54}/setup.py +8 -8
- organizations_local-0.0.53/organizations_local/src/organizations_constants.py +0 -19
- {organizations_local-0.0.53 → organizations_local-0.0.54}/README.md +0 -0
- {organizations_local-0.0.53 → organizations_local-0.0.54}/organizations_local/src/__init__.py +0 -0
- {organizations_local-0.0.53 → organizations_local-0.0.54}/organizations_local.egg-info/dependency_links.txt +0 -0
- {organizations_local-0.0.53 → organizations_local-0.0.54}/organizations_local.egg-info/requires.txt +0 -0
- {organizations_local-0.0.53 → organizations_local-0.0.54}/organizations_local.egg-info/top_level.txt +0 -0
- {organizations_local-0.0.53 → organizations_local-0.0.54}/pyproject.toml +0 -0
- {organizations_local-0.0.53 → organizations_local-0.0.54}/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
|
+
}
|
|
@@ -5,7 +5,7 @@ from language_remote.lang_code import LangCode
|
|
|
5
5
|
from logger_local.MetaLogger import MetaLogger
|
|
6
6
|
from user_context_remote.user_context import UserContext
|
|
7
7
|
|
|
8
|
-
from .
|
|
8
|
+
from .organizations_constants_src import ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT
|
|
9
9
|
|
|
10
10
|
user_context = UserContext()
|
|
11
11
|
|
|
@@ -57,13 +57,19 @@ DEFAULT_NOT_DELETED_ML_VIEW_NAME = "organization_ml_not_deleted_view"
|
|
|
57
57
|
# "description"
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
class OrganizationsLocal(
|
|
61
|
-
|
|
60
|
+
class OrganizationsLocal(
|
|
61
|
+
GenericCRUDML,
|
|
62
|
+
metaclass=MetaLogger,
|
|
63
|
+
object=ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT,
|
|
64
|
+
):
|
|
62
65
|
def __init__(self, is_test_data=False) -> None:
|
|
63
|
-
GenericCRUDML.__init__(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
GenericCRUDML.__init__(
|
|
67
|
+
self,
|
|
68
|
+
default_schema_name=DEFAULT_SCHEMA_NAME,
|
|
69
|
+
default_table_name=DEFAULT_TABLE_NAME,
|
|
70
|
+
default_column_name=DEFAULT_ID_COLUMN_NAME,
|
|
71
|
+
is_test_data=is_test_data,
|
|
72
|
+
)
|
|
67
73
|
self.default_view_table_name = DEFAULT_VIEW_NAME
|
|
68
74
|
|
|
69
75
|
@staticmethod
|
|
@@ -78,8 +84,14 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
|
|
|
78
84
|
|
|
79
85
|
@staticmethod
|
|
80
86
|
def _clean_organization_ml_dict(organization_dict: dict) -> dict:
|
|
81
|
-
columns = (
|
|
82
|
-
|
|
87
|
+
columns = (
|
|
88
|
+
"lang_code",
|
|
89
|
+
"is_main",
|
|
90
|
+
"title",
|
|
91
|
+
"is_title_approved",
|
|
92
|
+
"is_description_approved",
|
|
93
|
+
"description",
|
|
94
|
+
)
|
|
83
95
|
organization_ml_dict = {key: organization_dict.get(key) for key in columns}
|
|
84
96
|
return organization_ml_dict
|
|
85
97
|
|
|
@@ -133,12 +145,14 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
|
|
|
133
145
|
# TODO upsert_result_dict
|
|
134
146
|
upsert_information = {
|
|
135
147
|
"organization_id": organization_id,
|
|
136
|
-
"organization_ml_ids_list": organzation_ml_ids_list
|
|
148
|
+
"organization_ml_ids_list": organzation_ml_ids_list,
|
|
137
149
|
}
|
|
138
150
|
|
|
139
151
|
return upsert_information
|
|
140
152
|
|
|
141
|
-
def update_organization(
|
|
153
|
+
def update_organization(
|
|
154
|
+
self, *, organization_id: int, organization_ml_id: int, organization_dict: dict
|
|
155
|
+
) -> None:
|
|
142
156
|
# TODO: should we have such a method in CRUD ML? Same for delete
|
|
143
157
|
organization_ml_dict = self._clean_organization_ml_dict(
|
|
144
158
|
organization_dict)
|
|
@@ -164,7 +178,9 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
|
|
|
164
178
|
column_name="organization_ml_id")
|
|
165
179
|
organization_dict = self.select_one_dict_by_column_and_value(
|
|
166
180
|
view_table_name=view_table_name,
|
|
167
|
-
column_value=organization_id,
|
|
181
|
+
column_value=organization_id,
|
|
182
|
+
column_name="organization_id",
|
|
183
|
+
)
|
|
168
184
|
|
|
169
185
|
return {**organization_dict, **organization_ml_dict}
|
|
170
186
|
|
|
@@ -203,7 +219,7 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
|
|
|
203
219
|
view_table_name = view_table_name or DEFAULT_ML_VIEW_NAME
|
|
204
220
|
organizations_ids_and_names_list = []
|
|
205
221
|
select_clause_value = "organization_id, title"
|
|
206
|
-
placeholders =
|
|
222
|
+
placeholders = ", ".join(["%s"] * len(organizations_ids_list))
|
|
207
223
|
where_clause_value = f"organization_id in ({placeholders})"
|
|
208
224
|
organizations_ids_and_names_list = self.select_multi_tuple_by_where(
|
|
209
225
|
view_table_name=view_table_name,
|
|
@@ -235,9 +251,11 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
|
|
|
235
251
|
# Was def get_update_status(self, *, last_modified_timestamp: str, main_profile_id: int) -> UpdateStatus:
|
|
236
252
|
def get_update_status_and_information_list(self, *,
|
|
237
253
|
last_modified_timestamp: str,
|
|
238
|
-
main_profile_id: int
|
|
254
|
+
main_profile_id: int | None) -> list[dict]:
|
|
239
255
|
if main_profile_id is None:
|
|
240
|
-
update_status_and_information_list = [
|
|
256
|
+
update_status_and_information_list = [
|
|
257
|
+
{"update_status": UpdateStatus.UPDATE_CIRCLEZ}
|
|
258
|
+
]
|
|
241
259
|
return update_status_and_information_list
|
|
242
260
|
sync_conflict_resolution = SyncConflictResolution()
|
|
243
261
|
# TODO: Shall we also check update_timestamp in organization_table to see if the name was changed?
|
|
@@ -256,12 +274,17 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
|
|
|
256
274
|
if organization_id is not None:
|
|
257
275
|
organizations_ids_list.append(organization_id)
|
|
258
276
|
|
|
259
|
-
organizations_ids_and_names_list =
|
|
260
|
-
|
|
261
|
-
|
|
277
|
+
organizations_ids_and_names_list = (
|
|
278
|
+
self.get_organizations_ids_and_names_list_by_organizations_ids(
|
|
279
|
+
organizations_ids_list=organizations_ids_list,
|
|
280
|
+
view_table_name="organization_ml_view",
|
|
281
|
+
)
|
|
282
|
+
)
|
|
262
283
|
|
|
263
284
|
# Convert organizations_ids_and_names_list to a dictionary
|
|
264
|
-
organizations_ids_and_names_dict = {
|
|
285
|
+
organizations_ids_and_names_dict = {
|
|
286
|
+
item[0]: item[1] for item in organizations_ids_and_names_list
|
|
287
|
+
}
|
|
265
288
|
|
|
266
289
|
for update_status_and_information in update_status_and_information_list:
|
|
267
290
|
organization_id = update_status_and_information.get("organization_id")
|
|
@@ -270,7 +293,7 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
|
|
|
270
293
|
|
|
271
294
|
return update_status_and_information_list
|
|
272
295
|
|
|
273
|
-
def get_organization_name_by_organization_identifier(self, organization_identifier: str) -> str
|
|
296
|
+
def get_organization_name_by_organization_identifier(self, organization_identifier: str) -> str | None:
|
|
274
297
|
organization_name = self.select_one_value_by_column_and_value(
|
|
275
298
|
select_clause_value="name",
|
|
276
299
|
schema_name="organization",
|
{organizations_local-0.0.53 → organizations_local-0.0.54}/organizations_local.egg-info/SOURCES.txt
RENAMED
|
@@ -7,5 +7,5 @@ organizations_local.egg-info/dependency_links.txt
|
|
|
7
7
|
organizations_local.egg-info/requires.txt
|
|
8
8
|
organizations_local.egg-info/top_level.txt
|
|
9
9
|
organizations_local/src/__init__.py
|
|
10
|
-
organizations_local/src/
|
|
10
|
+
organizations_local/src/organizations_constants_src.py
|
|
11
11
|
organizations_local/src/organizations_local.py
|
|
@@ -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.54', # 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.53 → organizations_local-0.0.54}/organizations_local/src/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{organizations_local-0.0.53 → organizations_local-0.0.54}/organizations_local.egg-info/requires.txt
RENAMED
|
File without changes
|
{organizations_local-0.0.53 → organizations_local-0.0.54}/organizations_local.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|