organizations-local 0.0.28__py3-none-any.whl → 0.0.30__py3-none-any.whl

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.
@@ -167,6 +167,22 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
167
167
 
168
168
  return organizations_names_list
169
169
 
170
+ # Edited by Tal Goodman on 12.7.24
171
+ def get_organizations_ids_and_names_list_by_organizations_ids(
172
+ self, *, organizations_ids_list: list[int], lang_codes_list: list[LangCode] = None,
173
+ view_table_name: str = None) -> list[tuple[int, str]]:
174
+ lang_codes_list = lang_codes_list or [LangCode.ENGLISH]
175
+ view_table_name = view_table_name or DEFAULT_ML_VIEW_NAME
176
+ organizations_ids_and_names_list = []
177
+ select_clause_value = "organization_id, title"
178
+ where_clause_value = "organization_id in ({})".format(
179
+ ", ".join([str(organization_id) for organization_id in organizations_ids_list]))
180
+ organizations_ids_and_names_list = self.select_multi_tuple_by_where(
181
+ view_table_name=view_table_name, select_clause_value=select_clause_value,
182
+ where=where_clause_value, params=organizations_ids_list
183
+ )
184
+ return organizations_ids_and_names_list
185
+
170
186
  def delete_by_organization_id(self, organization_id: int, organization_ml_id: int = None) -> None:
171
187
  # Delete from organization_table
172
188
  self.delete_by_column_and_value(table_name="organization_table",
@@ -183,6 +199,7 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
183
199
  return test_organization_id
184
200
 
185
201
  # If we add the support of multiple organizations per contact, We will have to fix this method
202
+ # Edited by Tal Goodman on 12.7.24
186
203
  def get_update_status_and_information_list(self, *, last_modified_timestamp: str, main_profile_id: int) -> list[dict]:
187
204
  if main_profile_id is None:
188
205
  return UpdateStatus.UPDATE_CIRCLEZ
@@ -191,6 +208,25 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
191
208
  schema_name=DEFAULT_SCHEMA_NAME, view_table_name="organization_profile_view",
192
209
  where="profile_id = %s", params=(main_profile_id,), local_last_modified_column_name="updated_timestamp",
193
210
  remote_last_modified_timestamp=last_modified_timestamp)
211
+ # Add organization_names to update_status_and_information_list
212
+ organizations_ids_list = []
213
+ for update_status_and_information in update_status_and_information_list:
214
+ organization_id = update_status_and_information.get("organization_id")
215
+ if organization_id is not None:
216
+ organizations_ids_list.append(organization_id)
217
+
218
+ organizations_ids_and_names_list = self.get_organizations_ids_and_names_list_by_organizations_ids(
219
+ organizations_ids_list=organizations_ids_list,
220
+ view_table_name="organization_ml_view")
221
+
222
+ # Convert organizations_ids_and_names_list to a dictionary
223
+ organizations_ids_and_names_dict = {item["organization_id"]: item["title"] for item in organizations_ids_and_names_list}
224
+
225
+ for update_status_and_information in update_status_and_information_list:
226
+ organization_id = update_status_and_information.get("organization_id")
227
+ if organization_id is not None:
228
+ update_status_and_information["organization_name"] = organizations_ids_and_names_dict.get(organization_id)
229
+
194
230
  return update_status_and_information_list
195
231
 
196
232
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: organizations-local
3
- Version: 0.0.28
3
+ Version: 0.0.30
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
@@ -0,0 +1,7 @@
1
+ organizations_local/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ organizations_local/organizations_constants.py,sha256=pxyAMmv4BFCfzyDsF92vImLdazA7_0ecKyVmOR9peEE,900
3
+ organizations_local/organizations_local.py,sha256=va33gyETMzySTdA8jud3nzqZGmb0wkzQLIRlM8gc1zQ,13011
4
+ organizations_local-0.0.30.dist-info/METADATA,sha256=XuCRvNH7xNOACh3HU2F385ViPbk8MsKIElUSK5B6dlY,654
5
+ organizations_local-0.0.30.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
6
+ organizations_local-0.0.30.dist-info/top_level.txt,sha256=Y8wRcm3jFTyMdysBub_P8iqX1VOMS0ohUxA1GQdngFU,20
7
+ organizations_local-0.0.30.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- organizations_local/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- organizations_local/organizations_constants.py,sha256=pxyAMmv4BFCfzyDsF92vImLdazA7_0ecKyVmOR9peEE,900
3
- organizations_local/organizations_local.py,sha256=TViHrNnCa8y5Q7_xoKBhxrFpiffU-pM2Wn-l3DMYHvs,10891
4
- organizations_local-0.0.28.dist-info/METADATA,sha256=xLsi0xo4HzHESojPkBI5yCUVzAJhwoW88JF1Pdx4wPY,654
5
- organizations_local-0.0.28.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
6
- organizations_local-0.0.28.dist-info/top_level.txt,sha256=Y8wRcm3jFTyMdysBub_P8iqX1VOMS0ohUxA1GQdngFU,20
7
- organizations_local-0.0.28.dist-info/RECORD,,