contact-person-profile-csv-imp-local 0.0.49__py3-none-any.whl → 0.0.50__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.
- contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py +6 -54
- {contact_person_profile_csv_imp_local-0.0.49.dist-info → contact_person_profile_csv_imp_local-0.0.50.dist-info}/METADATA +1 -1
- {contact_person_profile_csv_imp_local-0.0.49.dist-info → contact_person_profile_csv_imp_local-0.0.50.dist-info}/RECORD +5 -5
- {contact_person_profile_csv_imp_local-0.0.49.dist-info → contact_person_profile_csv_imp_local-0.0.50.dist-info}/WHEEL +0 -0
- {contact_person_profile_csv_imp_local-0.0.49.dist-info → contact_person_profile_csv_imp_local-0.0.50.dist-info}/top_level.txt +0 -0
|
@@ -124,10 +124,7 @@ class CSVToContactPersonProfile(
|
|
|
124
124
|
'contact_location', 'user_externals_local',
|
|
125
125
|
'organizations_local', 'domain_local',
|
|
126
126
|
'importers_local']
|
|
127
|
-
GenericCRUD.__init__(self, default_schema_name="
|
|
128
|
-
default_column_name="field_id",
|
|
129
|
-
default_table_name="field_table",
|
|
130
|
-
default_view_table_name="field_view",
|
|
127
|
+
GenericCRUD.__init__(self, default_schema_name="entity_type",
|
|
131
128
|
is_test_data=is_test_data)
|
|
132
129
|
self.contact_entity_type_id = \
|
|
133
130
|
self.select_one_value_by_column_and_value(
|
|
@@ -173,32 +170,11 @@ class CSVToContactPersonProfile(
|
|
|
173
170
|
# Otherwise, return the value
|
|
174
171
|
return value
|
|
175
172
|
|
|
176
|
-
|
|
177
|
-
#
|
|
178
|
-
# """
|
|
179
|
-
# Get the field name from the database
|
|
180
|
-
# :param field_id: The field ID
|
|
181
|
-
# :param data_source_type_id: The data source ID
|
|
182
|
-
# :return: The field name
|
|
183
|
-
# """
|
|
184
|
-
#
|
|
185
|
-
# 'data_source_type_id': data_source_type_id})
|
|
186
|
-
|
|
187
|
-
# self.set_schema(schema_name="data_source_field")
|
|
188
|
-
# data_source_field_tuples = self.select_multi_tuple_by_where(view_table_name="data_source_field_view",
|
|
189
|
-
# select_clause_value="external_field_name",
|
|
190
|
-
# where="data_source_type_id = %s AND field_id = %s",
|
|
191
|
-
# params=(data_source_type_id, field_id))
|
|
192
|
-
|
|
193
|
-
# if data_source_field_tuples:
|
|
194
|
-
#
|
|
195
|
-
# return data_source_field_tuples[0][0]
|
|
196
|
-
# return
|
|
197
|
-
|
|
198
|
-
# TODO what are the diff between csv_path and directory_name?
|
|
173
|
+
|
|
174
|
+
# What are the diff between csv_path and directory_name?
|
|
199
175
|
# ans: csv_path is the full path to the csv file, directory_name is the directory where the csv file is located
|
|
200
176
|
|
|
201
|
-
#
|
|
177
|
+
# I think file name should be after directory_name and csv_path
|
|
202
178
|
# ans: it cannot be after directory_name and csv_path because it is a required parameter
|
|
203
179
|
|
|
204
180
|
# TODO: break this function into smaller functions
|
|
@@ -227,7 +203,7 @@ class CSVToContactPersonProfile(
|
|
|
227
203
|
:return:
|
|
228
204
|
"""
|
|
229
205
|
data_source_type_name = DataSources().get_data_source_name_by_id(data_source_type_id)
|
|
230
|
-
#
|
|
206
|
+
# There can be multiple profiles with the same email, why not to query `user_external_table`.`main_profile_id`?
|
|
231
207
|
# Answer: first, We can't query tables with GenericCRUD, second, we may not find profile_id in user_external table
|
|
232
208
|
# and may have to insert a new record to user_external_table, in this case we need profile_id from profile_view
|
|
233
209
|
profile_id = self.select_one_value_by_column_and_value(
|
|
@@ -243,7 +219,6 @@ class CSVToContactPersonProfile(
|
|
|
243
219
|
self.logger.error("Couldn't find profile_id in profile_view by email_address.")
|
|
244
220
|
raise Exception("Couldn't find profile_id in user_external or profile_view.")
|
|
245
221
|
system_id = system_id or CONTACT_PERSON_PROFILE_CSV_SYSTEM_ID
|
|
246
|
-
self.set_schema(schema_name="field")
|
|
247
222
|
self.list_of_group_dicts = list_of_group_dicts if list_of_group_dicts else []
|
|
248
223
|
'''
|
|
249
224
|
profile_id = ProfilesLocal().select_one_value_by_column_and_value(
|
|
@@ -252,7 +227,6 @@ class CSVToContactPersonProfile(
|
|
|
252
227
|
column_value=user_external_username)
|
|
253
228
|
'''
|
|
254
229
|
self.logger.info(f"profile_id: {profile_id}")
|
|
255
|
-
# TODO Please explain
|
|
256
230
|
# if csv_path is provided then we will use the full path
|
|
257
231
|
# if csv_path is not provided then we will use the directory_name and file_name to create the full path
|
|
258
232
|
# if directory_name is not provided the assumption is that the file is in the same directory as the script and not in a folder
|
|
@@ -346,6 +320,7 @@ class CSVToContactPersonProfile(
|
|
|
346
320
|
# contact_dict['last_name'] = process_last_name(
|
|
347
321
|
# original_last_name=contact_dict['last_name'])
|
|
348
322
|
|
|
323
|
+
|
|
349
324
|
# TODO This should be executed also by Google Contact Sync (please make sure it is in
|
|
350
325
|
# people-local-python-package i.e. get_display_name(first_name, last_name, organization) -> str
|
|
351
326
|
if contact_dict.get('display_as') is None:
|
|
@@ -357,8 +332,6 @@ class CSVToContactPersonProfile(
|
|
|
357
332
|
if not contact_dict['display_as'] and contact_dict.get('organization'):
|
|
358
333
|
contact_dict['display_as'] += " " + contact_dict['organization']
|
|
359
334
|
|
|
360
|
-
# TODO if contact_dict['display_as'] still empty raise?
|
|
361
|
-
|
|
362
335
|
# TODO process_notes( contact_dict[notes] )
|
|
363
336
|
|
|
364
337
|
# TODO We should take care of situation which the contact already exists and we need to update it
|
|
@@ -378,9 +351,6 @@ class CSVToContactPersonProfile(
|
|
|
378
351
|
data_source_instance_id=data_source_instance_id,
|
|
379
352
|
data_source_type_id=data_source_type_id)
|
|
380
353
|
contact_data_by_contact_id_dict[contact_id] = contact_dict
|
|
381
|
-
# groups_linked_by_job_title = process_job_title(contact_id=contact_id, job_title=contact_dict['job_title'])
|
|
382
|
-
# if groups_linked_by_job_title is None:
|
|
383
|
-
# logger.info("No groups linked by job title to contact " + str(contact_id))
|
|
384
354
|
|
|
385
355
|
return contact_data_by_contact_id_dict
|
|
386
356
|
|
|
@@ -676,24 +646,6 @@ class CSVToContactPersonProfile(
|
|
|
676
646
|
|
|
677
647
|
return contact_phone_ids
|
|
678
648
|
|
|
679
|
-
# old, TODO, do we need it?
|
|
680
|
-
def __insert_link_contact_user_external(self, contact_dict: dict) -> int:
|
|
681
|
-
contact_id = contact_dict.get("contact_id")
|
|
682
|
-
print("Before " + __name__, file=sys.stderr, flush=True)
|
|
683
|
-
contact_user_external_id = \
|
|
684
|
-
self.contact_user_external.insert_contact_and_link_to_existing_or_new_user_external(
|
|
685
|
-
contact_dict=contact_dict,
|
|
686
|
-
contact_email_address_str=contact_dict["email1"],
|
|
687
|
-
contact_id=contact_id,
|
|
688
|
-
system_id=contact_dict.get("system_id"),
|
|
689
|
-
# TODO What happends if contact do not have email?
|
|
690
|
-
# TODO I'm not sure we should use contact_dict["email1"] for user_external_dict["username"] probably bug
|
|
691
|
-
user_external_dict={"username": contact_dict["email1"]}
|
|
692
|
-
)
|
|
693
|
-
print("After " + __name__, file=sys.stderr, flush=True)
|
|
694
|
-
return contact_user_external_id
|
|
695
|
-
|
|
696
|
-
# new
|
|
697
649
|
def __insert_link_contact_user_external_by_contact_dict_and_user_external_dict(
|
|
698
650
|
self,
|
|
699
651
|
contact_dict: dict,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: contact-person-profile-csv-imp-local
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.50
|
|
4
4
|
Summary: PyPI Package for Circles CSVToContactPersonProfile-local Local/Remote Python
|
|
5
5
|
Home-page: https://github.com/circles-zone/contact-person-profile-csv-imp-local-python-package
|
|
6
6
|
Author: Circles
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=
|
|
1
|
+
contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=4sUZRqO8_s_uxPEB5VFbwvHvmCKqnaKW8-T49VaJZJs,52782
|
|
2
2
|
contact_person_profile_csv_imp_local/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
contact_person_profile_csv_imp_local/contact_person_profile_csv_imp_local_constants.py,sha256=SsMFKnI7y3P_kQxH21rxKnX7H4MZlemBy5vuv_Ns_a4,1180
|
|
4
|
-
contact_person_profile_csv_imp_local-0.0.
|
|
5
|
-
contact_person_profile_csv_imp_local-0.0.
|
|
6
|
-
contact_person_profile_csv_imp_local-0.0.
|
|
7
|
-
contact_person_profile_csv_imp_local-0.0.
|
|
4
|
+
contact_person_profile_csv_imp_local-0.0.50.dist-info/METADATA,sha256=sI9EXLOEYRrGb19fOKD-VLs1feswm8JL06rHFQ5JmpM,1589
|
|
5
|
+
contact_person_profile_csv_imp_local-0.0.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
+
contact_person_profile_csv_imp_local-0.0.50.dist-info/top_level.txt,sha256=at6BnVzULDB109KZx9Cl9ClCHU4c0ykfV38WX-QR71U,37
|
|
7
|
+
contact_person_profile_csv_imp_local-0.0.50.dist-info/RECORD,,
|
|
File without changes
|