Prep for ISHLT
This commit is contained in:
@@ -321,6 +321,7 @@ def get_event_exhibit_tracking_rec_list(
|
||||
{sql_select_event_person_id}
|
||||
{sql_hidden}
|
||||
{sql_enabled}
|
||||
AND allow_tracking = true
|
||||
ORDER BY `event_exhibit_tracking`.priority DESC, -`event_exhibit_tracking`.sort DESC, `event_exhibit_tracking`.created_on DESC, `event_exhibit_tracking`.updated_on DESC
|
||||
{sql_limit};
|
||||
"""
|
||||
|
||||
@@ -287,8 +287,8 @@ class Event_Badge_Basic_Base(BaseModel):
|
||||
# other_1: Optional[str]
|
||||
# other_2: Optional[str]
|
||||
|
||||
# agree_to_tc: Optional[bool] # Agree to terms and conditions
|
||||
allow_tracking: Optional[bool] # Allow tracking for lead retrieval and other marketing
|
||||
# agree_to_tc: Optional[bool] # Agree to terms and conditions
|
||||
|
||||
# print_first_datetime: Optional[datetime.datetime] = None
|
||||
# print_last_datetime: Optional[datetime.datetime] = None
|
||||
|
||||
@@ -120,19 +120,19 @@ class Event_Exhibit_Tracking_Base(BaseModel):
|
||||
# alias = 'person_phone_override'
|
||||
)
|
||||
|
||||
# event_badge_address_line_1: Optional[str]
|
||||
# event_badge_address_line_2: Optional[str]
|
||||
# event_badge_address_line_3: Optional[str]
|
||||
event_badge_address_line_1: Optional[str]
|
||||
event_badge_address_line_2: Optional[str]
|
||||
event_badge_address_line_3: Optional[str]
|
||||
|
||||
# event_badge_city: Optional[str]
|
||||
event_badge_city: Optional[str]
|
||||
|
||||
# event_badge_county: Optional[str] # NOTE: This is for a county within a state or province
|
||||
event_badge_county: Optional[str] # NOTE: This is for a county within a state or province
|
||||
|
||||
# event_badge_country_subdivision_code: Optional[str]
|
||||
# event_badge_state_province: Optional[str]
|
||||
# event_badge_state_province_abb: Optional[str]
|
||||
event_badge_country_subdivision_code: Optional[str]
|
||||
event_badge_state_province: Optional[str]
|
||||
event_badge_state_province_abb: Optional[str]
|
||||
|
||||
# event_badge_postal_code: Optional[str]
|
||||
event_badge_postal_code: Optional[str]
|
||||
|
||||
event_badge_country_alpha_2_code: Optional[str] = Field(
|
||||
# alias = 'person_country_alpha_2_code'
|
||||
@@ -158,6 +158,9 @@ class Event_Exhibit_Tracking_Base(BaseModel):
|
||||
|
||||
event_exhibit_name: Optional[str]
|
||||
|
||||
allow_tracking: Optional[bool]
|
||||
# event_exhibit_allow_tracking: Optional[bool] # This seems unnecessarily specific
|
||||
|
||||
# Including other related objects
|
||||
# event_badge: Optional[Union[Event_Badge_Base, None]]
|
||||
event_person: Optional[Union[Event_Person_Base, None]]
|
||||
|
||||
@@ -226,7 +226,7 @@ async def get_event_exhibit_tracking_obj(
|
||||
|
||||
|
||||
# ### BEGIN ### API Event Exhibit Tracking ### get_event_exhibit_obj_tracking_export() ###
|
||||
# Updated 2022-04-21
|
||||
# Updated 2023-04-10
|
||||
@router.get('/event/exhibit/{event_exhibit_id}/tracking/export', response_model=Resp_Body_Base)
|
||||
async def get_event_exhibit_obj_tracking_list(
|
||||
event_exhibit_id: str = Query(..., min_length=11, max_length=22),
|
||||
@@ -243,6 +243,9 @@ async def get_event_exhibit_obj_tracking_list(
|
||||
if event_exhibit_id := redis_lookup_id_random(record_id_random=event_exhibit_id, table_name='event_exhibit'): pass
|
||||
else: return mk_resp(data=None, status_code=404, response=commons.response)
|
||||
|
||||
# NOTE FUTURE: Use allowed_field_names in the future either set from the event as a whole or individual person. Use as column_name_li below.
|
||||
# allowed_field_names = ['exhibit_tracking_id', 'badge_id']
|
||||
|
||||
if event_exhibit_tracking_rec_list_result := get_event_exhibit_tracking_rec_list(
|
||||
event_exhibit_id = event_exhibit_id,
|
||||
enabled = commons.enabled,
|
||||
@@ -261,6 +264,7 @@ async def get_event_exhibit_obj_tracking_list(
|
||||
event_exhibit_tracking_result_list.append(load_event_exhibit_tracking_result)
|
||||
event_exhibit_tracking_obj = load_event_exhibit_tracking_result
|
||||
|
||||
# NOTE: Deal with field overrides made within Aether
|
||||
if event_exhibit_tracking_obj.event_badge_pronouns_override:
|
||||
event_exhibit_tracking_obj.event_badge_pronouns = event_exhibit_tracking_obj.event_badge_pronouns_override
|
||||
event_exhibit_tracking_obj.event_badge_pronouns_override = None
|
||||
@@ -301,9 +305,9 @@ async def get_event_exhibit_obj_tracking_list(
|
||||
# return False
|
||||
|
||||
data_dict = event_exhibit_tracking_dict
|
||||
# data_dict = event_exhibit_tracking_obj.dict(by_alias=True, exclude_unset=False)
|
||||
|
||||
|
||||
# NOTE: Rename the fields to be more end user (exhibitor) friendly
|
||||
# NOTE: The field overrides are taken care above
|
||||
data_dict['exhibit_tracking_id'] = data_dict.pop('event_exhibit_tracking_id_random', None)
|
||||
data_dict['badge_id'] = data_dict.pop('event_badge_id_random', None)
|
||||
|
||||
@@ -316,25 +320,22 @@ async def get_event_exhibit_obj_tracking_list(
|
||||
|
||||
data_dict['person_designations'] = data_dict.pop('event_badge_designations', None)
|
||||
data_dict['person_professional_title'] = data_dict.pop('event_badge_professional_title', None)
|
||||
# data_dict['person_professional_title_override'] = data_dict.pop('event_badge_professional_title_override', None)
|
||||
|
||||
data_dict['person_full_name'] = data_dict.pop('event_badge_full_name', None)
|
||||
# data_dict['person_full_name_override'] = data_dict.pop('event_badge_full_name_override', None)
|
||||
|
||||
data_dict['person_affiliations'] = data_dict.pop('event_badge_affiliations', None)
|
||||
# data_dict['person_affiliations_override'] = data_dict.pop('event_badge_affiliations_override', None)
|
||||
|
||||
data_dict['person_email'] = data_dict.pop('event_badge_email', None)
|
||||
|
||||
# if 'event_badge_address_line_1' in data_dict:
|
||||
# data_dict['person_address_line_1'] = data_dict.pop('event_badge_address_line_1', None)
|
||||
# else: data_dict['person_address_line_1'] = None
|
||||
# if 'event_badge_address_line_2' in data_dict:
|
||||
# data_dict['person_address_line_2'] = data_dict.pop('event_badge_address_line_2', None)
|
||||
# else: data_dict['person_address_line_2'] = None
|
||||
# if 'event_badge_address_line_3' in data_dict:
|
||||
# data_dict['person_address_line_3'] = data_dict.pop('event_badge_address_line_3', None)
|
||||
# else: data_dict['person_address_line_3'] = None
|
||||
if 'event_badge_address_line_1' in data_dict:
|
||||
data_dict['person_address_line_1'] = data_dict.pop('event_badge_address_line_1', None)
|
||||
else: data_dict['person_address_line_1'] = None
|
||||
if 'event_badge_address_line_2' in data_dict:
|
||||
data_dict['person_address_line_2'] = data_dict.pop('event_badge_address_line_2', None)
|
||||
else: data_dict['person_address_line_2'] = None
|
||||
if 'event_badge_address_line_3' in data_dict:
|
||||
data_dict['person_address_line_3'] = data_dict.pop('event_badge_address_line_3', None)
|
||||
else: data_dict['person_address_line_3'] = None
|
||||
|
||||
if 'event_badge_city' in data_dict:
|
||||
data_dict['person_city'] = data_dict.pop('event_badge_city', None)
|
||||
@@ -364,9 +365,6 @@ async def get_event_exhibit_obj_tracking_list(
|
||||
if 'event_badge_location' in data_dict:
|
||||
data_dict['person_location'] = data_dict.pop('event_badge_location', None)
|
||||
else: data_dict['person_location'] = None
|
||||
# if 'event_badge_location_override' in data_dict:
|
||||
# data_dict['person_location_override'] = data_dict.pop('event_badge_location_override', None)
|
||||
# else: data_dict['person_location_override'] = None
|
||||
|
||||
log.debug(data_dict)
|
||||
|
||||
@@ -402,16 +400,16 @@ async def get_event_exhibit_obj_tracking_list(
|
||||
|
||||
'person_email',
|
||||
|
||||
# # 'person_address_line_1',
|
||||
# # 'person_address_line_2',
|
||||
# # 'person_address_line_3',
|
||||
# 'person_address_line_1',
|
||||
# 'person_address_line_2',
|
||||
# 'person_address_line_3',
|
||||
|
||||
# # 'person_city',
|
||||
'person_city',
|
||||
|
||||
# # 'person_country_subdivision_code', 'person_state_province_abb',
|
||||
# # 'person_state_province',
|
||||
'person_country_subdivision_code', 'person_state_province_abb',
|
||||
'person_state_province',
|
||||
|
||||
# # 'person_postal_code',
|
||||
# 'person_postal_code',
|
||||
|
||||
'person_country_alpha_2_code',
|
||||
'person_country',
|
||||
|
||||
@@ -1629,6 +1629,7 @@ async def importing_cont_edu_cert_person_data_touch(
|
||||
# Updated 2022-04-06
|
||||
@router.get('/bgh_program_import', response_model=Resp_Body_Base)
|
||||
async def bgh_program_import(
|
||||
event_id: str = Query(..., min_length=11, max_length=22),
|
||||
begin_at: int = 0,
|
||||
end_at: int = 100,
|
||||
# response: Response = Response,
|
||||
@@ -1638,10 +1639,14 @@ async def bgh_program_import(
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
account_id = commons.x_account_id # 4 GpLf_bnywCs
|
||||
event_id = 1446
|
||||
account_id = commons.x_account_id # GpLf_bnywCs (4)
|
||||
|
||||
full_file_path = 'admin/temp/import_bgh_2022-04_program_data.csv'
|
||||
# BG 2023-04: zJP-Ld-A7-I4 (1447)
|
||||
if event_id := redis_lookup_id_random(record_id_random=event_id, table_name='event'): pass
|
||||
# elif event_exhibit_id is None: pass
|
||||
else: return mk_resp(data=None, status_code=404, response=commons.response, status_message='The Event ID was invalid or not found.')
|
||||
|
||||
full_file_path = 'admin/temp/import_bgh_2023-04_program_data.csv'
|
||||
|
||||
df = pandas.read_csv(
|
||||
full_file_path,
|
||||
@@ -1649,7 +1654,7 @@ async def bgh_program_import(
|
||||
dtype = {
|
||||
'session_code': str,
|
||||
'Session Code': str,
|
||||
'session_title': str,
|
||||
'session_title': str, # NOTE: "title", not "name"
|
||||
'session_description': str,
|
||||
'session_start_datetime': str,
|
||||
'session_end_datetime': str,
|
||||
@@ -1694,11 +1699,13 @@ async def bgh_program_import(
|
||||
session_dict['start_datetime'] = record.get('session_start_datetime')
|
||||
session_dict['end_datetime'] = record.get('session_end_datetime')
|
||||
location_name = record.get('location_name')
|
||||
if location_name == 'Broadway 1': session_dict['event_location_id'] = 301
|
||||
elif location_name == 'Broadway 2': session_dict['event_location_id'] = 302
|
||||
elif location_name == 'Broadway 3': session_dict['event_location_id'] = 303
|
||||
elif location_name == 'Grand Ballroom': session_dict['event_location_id'] = 304
|
||||
elif location_name == 'Sobro': session_dict['event_location_id'] = 305
|
||||
if location_name == 'Grand Ballroom': session_dict['event_location_id'] = 349
|
||||
elif location_name == 'Justice': session_dict['event_location_id'] = 350
|
||||
elif location_name == 'Russell Cannon Hart': session_dict['event_location_id'] = 351
|
||||
elif location_name == 'Salon D': session_dict['event_location_id'] = 352
|
||||
elif location_name == 'Salon EF': session_dict['event_location_id'] = 353
|
||||
elif location_name == 'Salon F': session_dict['event_location_id'] = 354
|
||||
elif location_name == 'Salon G': session_dict['event_location_id'] = 355
|
||||
|
||||
create_update_event_session_obj_v4_result = create_update_event_session_obj_v4(
|
||||
event_session_dict_obj = session_dict,
|
||||
@@ -1724,8 +1731,8 @@ async def aapor_program_import(
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
account_id = commons.x_account_id # 20 j5EBhRDqPuw
|
||||
# AAPOR 2022: 1447 x2H2P2MYlXU
|
||||
account_id = commons.x_account_id # j5EBhRDqPuw (20)
|
||||
# AAPOR 2022: x2H2P2MYlXU (1447)
|
||||
|
||||
if event_id := redis_lookup_id_random(record_id_random=event_id, table_name='event'): pass
|
||||
# elif event_exhibit_id is None: pass
|
||||
@@ -2130,7 +2137,7 @@ async def cmsc_program_import(
|
||||
session_data['start_datetime'] = record.get('session_start_datetime')
|
||||
session_data['end_datetime'] = record.get('session_end_datetime')
|
||||
location_name = record.get('location_name')
|
||||
|
||||
|
||||
if location_name == 'Annapolis 1-4': session_data['event_location_id'] = 319
|
||||
elif location_name == 'Potomac 1-3': session_data['event_location_id'] = 320
|
||||
elif location_name == 'Potomac 4-6': session_data['event_location_id'] = 321
|
||||
|
||||
Reference in New Issue
Block a user