Working on event registrations
This commit is contained in:
@@ -77,7 +77,7 @@ async def get_product_obj_li(
|
|||||||
by_alias: Optional[bool] = True,
|
by_alias: Optional[bool] = True,
|
||||||
exclude_unset: Optional[bool] = True,
|
exclude_unset: Optional[bool] = True,
|
||||||
):
|
):
|
||||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
log.debug(locals())
|
log.debug(locals())
|
||||||
|
|
||||||
obj_type = 'product'
|
obj_type = 'product'
|
||||||
@@ -93,9 +93,18 @@ async def get_product_obj_li(
|
|||||||
data['for_obj_id_random'] = for_obj_id_random
|
data['for_obj_id_random'] = for_obj_id_random
|
||||||
|
|
||||||
sql_for_obj_type = f"""`product`.account_id = :for_obj_id"""
|
sql_for_obj_type = f"""`product`.account_id = :for_obj_id"""
|
||||||
|
elif for_obj_type == 'event' and for_obj_id:
|
||||||
|
for_obj_id_random = for_obj_id
|
||||||
|
for_obj_id = redis_lookup_id_random(record_id_random=for_obj_id_random, table_name=for_obj_type)
|
||||||
|
|
||||||
|
data['for_obj_type'] = for_obj_type
|
||||||
|
data['for_obj_id'] = for_obj_id
|
||||||
|
data['for_obj_id_random'] = for_obj_id_random
|
||||||
|
|
||||||
|
sql_for_obj_type = f"""`product`.for_type = :for_obj_type AND `product`.for_id = :for_obj_id"""
|
||||||
else: sql_for_obj_type = ''
|
else: sql_for_obj_type = ''
|
||||||
|
|
||||||
if prod_type in ['event', 'event option', 'membership', 'fundraising']:
|
if prod_type in ['event', 'event_option', 'membership', 'fundraising']:
|
||||||
data['type_name'] = prod_type
|
data['type_name'] = prod_type
|
||||||
|
|
||||||
sql_product_type = f"""AND product.type_name = :type_name"""
|
sql_product_type = f"""AND product.type_name = :type_name"""
|
||||||
@@ -108,6 +117,10 @@ async def get_product_obj_li(
|
|||||||
{sql_product_type}
|
{sql_product_type}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
|
log.debug(data)
|
||||||
|
log.debug(sql)
|
||||||
|
|
||||||
if sql_result := sql_select(data=data, sql=sql, as_list=True):
|
if sql_result := sql_select(data=data, sql=sql, as_list=True):
|
||||||
resp_data_li = []
|
resp_data_li = []
|
||||||
for record in sql_result:
|
for record in sql_result:
|
||||||
|
|||||||
Reference in New Issue
Block a user