Improved SQL INSERT and UPDATE with JSON or dict values.

This commit is contained in:
Scott Idem
2023-02-08 19:28:45 -05:00
parent d1c373f7fb
commit b66a7f4707
3 changed files with 13 additions and 6 deletions

View File

@@ -121,8 +121,8 @@ def update_event_exhibit_tracking_obj(
# NOTE: This is needed for the SQL update to work.
# NOTE: Should something like this be moved to the sql_update and sql_insert functions? If a field ends in _json or the field data type is a dict?
if responses_json := event_exhibit_tracking_dict.get('responses_json'):
event_exhibit_tracking_dict['responses_json'] = json.dumps(responses_json)
# if responses_json := event_exhibit_tracking_dict.get('responses_json'):
# event_exhibit_tracking_dict['responses_json'] = json.dumps(responses_json)
# ### SECTION ### Process data
if event_exhibit_tracking_dict_up_result := sql_update(