Now with the ability to do OR with LIKE

This commit is contained in:
Scott Idem
2024-06-21 14:46:19 -04:00
parent 4d3c75dbcf
commit 175c84b1a6
3 changed files with 55 additions and 0 deletions

View File

@@ -383,6 +383,9 @@ def handle_get_obj_li(
# This should be a dict list of fields with a list of values to search for using AND IN.
and_in_dict_li_obj = None
# This should be a dict list of fields with a list of values to search for using OR LIKE.
or_like_dict_obj = None
jp_obj = None
if jp:
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
@@ -404,6 +407,9 @@ def handle_get_obj_li(
if jp_obj.get('and_like'): # NOTE: This is for the additional AND LIKE clauses in the WHERE statement
and_like_dict_obj = jp_obj['and_like']
if jp_obj.get('or_like'): # NOTE: This is for the additional OR LIKE clauses in the WHERE statement
or_like_dict_obj = jp_obj['or_like']
if jp_obj.get('and_in_li'): # NOTE: This is for the additional AND IN clauses in the WHERE statement
and_in_dict_li_obj = jp_obj['and_in_li']
@@ -496,6 +502,7 @@ def handle_get_obj_li(
fulltext_qry_dict = fulltext_qry_dict_obj,
and_qry_dict = and_qry_dict_obj,
and_like_dict = and_like_dict_obj,
or_like_dict = or_like_dict_obj,
and_in_dict_li = and_in_dict_li_obj,
# fulltext_qry_field_li = fulltext_qry_field_li,
# fulltext_qry_str = fulltext_qry_str,
@@ -515,6 +522,7 @@ def handle_get_obj_li(
fulltext_qry_dict = fulltext_qry_dict_obj,
and_qry_dict = and_qry_dict_obj,
and_like_dict = and_like_dict_obj,
or_like_dict = or_like_dict_obj,
and_in_dict_li = and_in_dict_li_obj,
# fulltext_qry_field_li = fulltext_qry_field_li,
# fulltext_qry_str = fulltext_qry_str,

View File

@@ -331,6 +331,9 @@ def handle_get_obj_li(
if jp_obj.get('and_like'): # NOTE: This is for the additional AND LIKE clauses in the WHERE statement
and_like_dict_obj = jp_obj['and_like']
if jp_obj.get('or_like'): # NOTE: This is for the additional OR LIKE clauses in the WHERE statement
or_like_dict_obj = jp_obj['or_like']
if jp_obj.get('and_in_li'): # NOTE: This is for the additional AND IN clauses in the WHERE statement
and_in_dict_li_obj = jp_obj['and_in_li']
@@ -442,6 +445,7 @@ def handle_get_obj_li(
fulltext_qry_dict = fulltext_qry_dict_obj,
and_qry_dict = and_qry_dict_obj,
and_like_dict = and_like_dict_obj,
or_like_dict = or_like_dict_obj,
and_in_dict_li = and_in_dict_li_obj,
# fulltext_qry_field_li = fulltext_qry_field_li,
# fulltext_qry_str = fulltext_qry_str,
@@ -461,6 +465,7 @@ def handle_get_obj_li(
fulltext_qry_dict = fulltext_qry_dict_obj,
and_qry_dict = and_qry_dict_obj,
and_like_dict = and_like_dict_obj,
or_like_dict = or_like_dict_obj,
and_in_dict_li = and_in_dict_li_obj,
# fulltext_qry_field_li = fulltext_qry_field_li,
# fulltext_qry_str = fulltext_qry_str,