organizations-local 0.0.27__tar.gz → 0.0.29__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: organizations-local
3
- Version: 0.0.27
3
+ Version: 0.0.29
4
4
  Summary: PyPI Package for Circles organizations-local Python
5
5
  Home-page: https://github.com/circles-zone/organizations-local-python-package
6
6
  Author: Circles
@@ -167,6 +167,21 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
167
167
 
168
168
  return organizations_names_list
169
169
 
170
+ def get_organizations_ids_and_names_list_by_organizations_ids(
171
+ self, *, organizations_ids_list: list[int], lang_codes_list: list[LangCode] = None,
172
+ view_table_name: str = None) -> list[tuple[int, str]]:
173
+ lang_codes_list = lang_codes_list or [LangCode.ENGLISH]
174
+ view_table_name = view_table_name or DEFAULT_ML_VIEW_NAME
175
+ organizations_ids_and_names_list = []
176
+ select_clause_value = "organization_id, title"
177
+ where_clause_value = "organization_id in ({})".format(
178
+ ", ".join([str(organization_id) for organization_id in organizations_ids_list]))
179
+ organizations_ids_and_names_list = self.select_multi_tuple_by_where(
180
+ view_table_name=view_table_name, select_clause_value=select_clause_value,
181
+ where=where_clause_value, params=organizations_ids_list
182
+ )
183
+ return organizations_ids_and_names_list
184
+
170
185
  def delete_by_organization_id(self, organization_id: int, organization_ml_id: int = None) -> None:
171
186
  # Delete from organization_table
172
187
  self.delete_by_column_and_value(table_name="organization_table",
@@ -183,12 +198,30 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
183
198
  return test_organization_id
184
199
 
185
200
  # If we add the support of multiple organizations per contact, We will have to fix this method
186
- def get_update_status(self, *, last_modified_timestamp: str, main_profile_id: int) -> UpdateStatus:
201
+ def get_update_status_and_information_list(self, *, last_modified_timestamp: str, main_profile_id: int) -> list[dict]:
187
202
  if main_profile_id is None:
188
203
  return UpdateStatus.UPDATE_CIRCLEZ
189
204
  sync_conflict_resolution = SyncConflictResolution()
190
- update_status: UpdateStatus = sync_conflict_resolution.get_update_status_by_where(
205
+ update_status_and_information_list: list[dict] = sync_conflict_resolution.get_update_status_and_information_list_by_where(
191
206
  schema_name=DEFAULT_SCHEMA_NAME, view_table_name="organization_profile_view",
192
- where="profile_id = %s", params=(main_profile_id,), select_clause_value="updated_timestamp",
207
+ where="profile_id = %s", params=(main_profile_id,), local_last_modified_column_name="updated_timestamp",
193
208
  remote_last_modified_timestamp=last_modified_timestamp)
194
- return update_status
209
+ # Add organization_names to update_status_and_information_list
210
+ organization_names_list = self.get_organizations_names_list_by_organizations_ids(
211
+ organizations_ids_list=[update_status_and_information_dict.get("organization_id") for
212
+ update_status_and_information_dict in update_status_and_information_list])
213
+
214
+ return update_status_and_information_list
215
+
216
+
217
+
218
+ def get_organization_name_by_organization_identifier(self, organization_identifier: str) -> str or None:
219
+ organization_name=self.select_one_value_by_column_and_value(
220
+ select_clause_value="name",
221
+ schema_name="organization",
222
+ view_table_name="organization_view",
223
+ column_name="identifier",
224
+ column_value=organization_identifier,
225
+ )
226
+
227
+ return organization_name
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: organizations-local
3
- Version: 0.0.27
3
+ Version: 0.0.29
4
4
  Summary: PyPI Package for Circles organizations-local Python
5
5
  Home-page: https://github.com/circles-zone/organizations-local-python-package
6
6
  Author: Circles
@@ -3,9 +3,10 @@ import setuptools
3
3
  PACKAGE_NAME = "organizations-local"
4
4
  package_dir = PACKAGE_NAME.replace("-", "_")
5
5
 
6
+
6
7
  setuptools.setup(
7
8
  name=PACKAGE_NAME,
8
- version='0.0.27', # https://pypi.org/project/organizations-local/
9
+ version='0.0.29', # https://pypi.org/project/organizations-local/
9
10
  author="Circles",
10
11
  author_email="info@circlez.ai",
11
12
  description="PyPI Package for Circles organizations-local Python",