organizations-local 0.0.27__py3-none-any.whl → 0.0.29__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.
- organizations_local/organizations_local.py +37 -4
- {organizations_local-0.0.27.dist-info → organizations_local-0.0.29.dist-info}/METADATA +1 -1
- organizations_local-0.0.29.dist-info/RECORD +7 -0
- {organizations_local-0.0.27.dist-info → organizations_local-0.0.29.dist-info}/WHEEL +1 -1
- organizations_local-0.0.27.dist-info/RECORD +0 -7
- {organizations_local-0.0.27.dist-info → organizations_local-0.0.29.dist-info}/top_level.txt +0 -0
|
@@ -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
|
|
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
|
-
|
|
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,),
|
|
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
|
-
|
|
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
|
|
@@ -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=3gRpq7EGHNw5xhPAtImNYDf6JZoqjPK8WIvbdKU054o,12177
|
|
4
|
+
organizations_local-0.0.29.dist-info/METADATA,sha256=s-hTqXzpdCIHh6-0F18aaZa_Ysro51JLxnQj7r92m8c,654
|
|
5
|
+
organizations_local-0.0.29.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
|
|
6
|
+
organizations_local-0.0.29.dist-info/top_level.txt,sha256=Y8wRcm3jFTyMdysBub_P8iqX1VOMS0ohUxA1GQdngFU,20
|
|
7
|
+
organizations_local-0.0.29.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=ika3TEYhrVB66o7wRAAZMQsBX-N7i7bxwLPYl4s4Hk8,10018
|
|
4
|
-
organizations_local-0.0.27.dist-info/METADATA,sha256=rcx-kV7etxfpamYS87qE9OjtenEYlK4D9L5goPVSAI8,654
|
|
5
|
-
organizations_local-0.0.27.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
|
6
|
-
organizations_local-0.0.27.dist-info/top_level.txt,sha256=Y8wRcm3jFTyMdysBub_P8iqX1VOMS0ohUxA1GQdngFU,20
|
|
7
|
-
organizations_local-0.0.27.dist-info/RECORD,,
|
|
File without changes
|