Minor changes and updates.

This commit is contained in:
Scott Idem
2024-03-22 19:35:50 -04:00
parent 0dd3bbea73
commit 83aa943410
3 changed files with 24 additions and 15 deletions

View File

@@ -16,6 +16,8 @@ class Api_Crud_Base(BaseModel):
super_key: Optional[str] = None # Query(None, min_length=8, max_length=50),
jwt: Optional[str] = None
create_key: Optional[str] = None # Query(None, min_length=6, max_length=50),
read_key: Optional[str] = None # Query(None, min_length=5, max_length=50),
update_key: Optional[str] = None # Query(None, min_length=6, max_length=50),

View File

@@ -8,7 +8,7 @@ from app.lib_general import log, logging
from app.models.common_field_schema import base_fields, default_num_bytes
from app.models.event_badge_models import Event_Badge_Base
# from app.models.event_badge_models import Event_Badge_Base
from app.models.event_person_models import Event_Person_Base
@@ -37,6 +37,8 @@ class Event_Exhibit_Tracking_Base(BaseModel):
event_badge_id_random: Optional[str]
event_badge_id: Optional[int]
external_person_id: Optional[str] # This is probably an email address
exhibitor_notes: Optional[str]
responses_json: Optional[Json] # NOTE: Responses to custom questions
# responses_json: Json = [{'test': ''}] # NOTE: Responses to custom questions

View File

@@ -248,6 +248,7 @@ async def get_obj_li(
jp_obj = None
if jp:
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug( urllib.parse.unquote(jp) )
try:
jp_obj = json.loads(urllib.parse.unquote(jp))
@@ -266,6 +267,8 @@ async def get_obj_li(
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']
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
if order_by_li:
order_by_li = json.loads(order_by_li)
@@ -336,8 +339,10 @@ async def get_obj_li(
if for_obj_type and for_obj_id:
for_obj_id = redis_lookup_id_random(record_id_random=for_obj_id, table_name=for_obj_type)
# log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(f'for_obj_type: {for_obj_type}')
log.debug(f'for_obj_id: {for_obj_id}')
# log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
field_name = f'{for_obj_type}_id'
@@ -363,20 +368,20 @@ async def get_obj_li(
# NOTE: The enabled and hidden parameters are new to this endpoint and the sql_select function! -2023-07-06
# NOTE: This call (without field_name, field_value, limit, offset) may need more testing.
sql_result = sql_select(
table_name = table_name,
enabled = commons.enabled,
hidden = hidden,
fulltext_qry_dict = fulltext_qry_dict_obj,
and_qry_dict = and_qry_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,
order_by_li = order_by_li,
limit = commons.limit,
offset = commons.offset,
as_list = True,
# log_lvl = logging.DEBUG
)
table_name = table_name,
enabled = commons.enabled,
hidden = hidden,
fulltext_qry_dict = fulltext_qry_dict_obj,
and_qry_dict = and_qry_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,
order_by_li = order_by_li,
limit = commons.limit,
offset = commons.offset,
as_list = True,
# log_lvl = logging.DEBUG
)
# log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(sql_result)