Work on abstracts.

This commit is contained in:
Scott Idem
2023-05-05 17:29:02 -04:00
parent 2698f06c57
commit 916cca1d73
4 changed files with 30 additions and 18 deletions

View File

@@ -41,6 +41,9 @@ class Data_Store_Base(BaseModel):
description: Optional[str]
# json: Optional[str] # "json" is reserved; need to change field name? json_str?
json_str: Optional[Union[Json, None]] = Field(
alias = 'json',
)
text: Optional[str]
meta_json: Optional[str]
meta_text: Optional[str]

View File

@@ -33,7 +33,7 @@ class Event_Abstract_Base(BaseModel):
event_id_random: Optional[str]
event_id: Optional[int]
event_person_id_random: Optional[str]
event_person_id_random: Optional[str] # This is the primary person/submitter
event_person_id: Optional[int]
event_presentation_id_random: Optional[str]
@@ -48,15 +48,19 @@ class Event_Abstract_Base(BaseModel):
# event_track_id_random: Optional[str]
# event_track_id: Optional[int]
poc_event_person_id_random: Optional[str] # Maybe change this to primary_event_person?
poc_event_person_id: Optional[int] # Maybe change this to primary_event_person?
# poc_event_person_id_random: Optional[str] # Maybe change this to primary_event_person?
# poc_event_person_id: Optional[int] # Maybe change this to primary_event_person?
external_id: Optional[str]
grant_id: Optional[str]
code: Optional[str]
name: Optional[str]
description: Optional[str]
abstract: Optional[str]
passcode: Optional[str] # = '7777777'
data_json: Optional[Json]
enable: Optional[bool]
@@ -127,14 +131,14 @@ class Event_Abstract_Base(BaseModel):
return redis_lookup_id_random(record_id_random=id_random, table_name='event_session')
return None
@validator('poc_event_person_id', always=True)
def poc_event_person_id_lookup(cls, v, values, **kwargs):
log.setLevel(logging.WARNING)
log.debug(locals())
# @validator('poc_event_person_id', always=True)
# def poc_event_person_id_lookup(cls, v, values, **kwargs):
# log.setLevel(logging.WARNING)
# log.debug(locals())
if values['poc_event_person_id_random']:
return redis_lookup_id_random(record_id_random=values['poc_event_person_id_random'], table_name='poc_event_person')
return None
# if values['poc_event_person_id_random']:
# return redis_lookup_id_random(record_id_random=values['poc_event_person_id_random'], table_name='poc_event_person')
# return None
class Config:
underscore_attrs_are_private = True
@@ -173,11 +177,16 @@ class Event_Abstract_Base_New(Core_Std_Obj_Base):
# event_track_id_random: Optional[str]
poc_event_person_id_random: Optional[str] # Maybe change this to primary_event_person?
# poc_event_person_id_random: Optional[str] # Maybe change this to primary_event_person?
external_id: Optional[str]
grant_id: Optional[str]
description: Optional[str]
abstract: Optional[str]
passcode: Optional[str]
class Config:
underscore_attrs_are_private = True
allow_population_by_field_name = True

View File

@@ -29,7 +29,7 @@ async def post_event_abstract_obj(
# create_sub_obj: bool = False,
# fail_any: bool = True, # Fail if any thing goes wrong for sub objects
return_obj: bool = True,
return_obj: bool = False,
inc_event_file_list: bool = False,
inc_event_person: bool = False,
inc_event_presentation_list: bool = False,
@@ -49,8 +49,8 @@ async def post_event_abstract_obj(
# There should probably be a check for the event ID before calling the create function?
if create_event_abstract_obj_result := create_update_event_abstract_obj(
event_abstract_obj = event_abstract_obj,
event_id = event_abstract_obj.event_id,
event_person_id = event_abstract_obj.event_person_id,
event_id = event_id, # event_abstract_obj.event_id,
event_person_id = event_person_id, # event_abstract_obj.event_person_id,
# create_sub_obj = create_sub_obj,
# fail_any = fail_any,
return_outline = False,
@@ -193,7 +193,7 @@ async def get_event_abstract_obj(
# ### END ### API Event Abstract ### get_event_abstract_obj() ###
# ### BEGIN ### API Event Exhibit Tracking ### delete_event_abstract_obj() ###
# ### BEGIN ### API Event Abstract ### delete_event_abstract_obj() ###
# Updated 2023-03-22
@router.delete('/event/abstract/{event_abstract_id}', response_model=Resp_Body_Base)
def delete_event_abstract_obj(
@@ -222,4 +222,4 @@ def delete_event_abstract_obj(
else:
log.warning('Likely bad request')
return mk_resp(data=False, status_code=400, response=response) # Bad Request
# ### END ### API Event Exhibit Tracking ### delete_event_abstract_obj() ###
# ### END ### API Event Abstract ### delete_event_abstract_obj() ###

View File

@@ -38,14 +38,14 @@ async def v4_post_event_person_obj_new(
inc_user: bool = False,
x_account_id: str = Header(...),
return_obj: bool = True,
return_obj: bool = False, # Should this default to False??? -2023-05-05
limit: int = 500,
enabled: str = 'enabled',
by_alias: bool = True,
exclude_unset: bool = True,
response: Response = Response,
):
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
# There should probably be a check for the event ID before calling the create function?