Work on abstracts.
This commit is contained in:
@@ -41,6 +41,9 @@ class Data_Store_Base(BaseModel):
|
|||||||
description: Optional[str]
|
description: Optional[str]
|
||||||
|
|
||||||
# json: Optional[str] # "json" is reserved; need to change field name? json_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]
|
text: Optional[str]
|
||||||
meta_json: Optional[str]
|
meta_json: Optional[str]
|
||||||
meta_text: Optional[str]
|
meta_text: Optional[str]
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Event_Abstract_Base(BaseModel):
|
|||||||
event_id_random: Optional[str]
|
event_id_random: Optional[str]
|
||||||
event_id: Optional[int]
|
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_person_id: Optional[int]
|
||||||
|
|
||||||
event_presentation_id_random: Optional[str]
|
event_presentation_id_random: Optional[str]
|
||||||
@@ -48,15 +48,19 @@ class Event_Abstract_Base(BaseModel):
|
|||||||
# event_track_id_random: Optional[str]
|
# event_track_id_random: Optional[str]
|
||||||
# event_track_id: Optional[int]
|
# event_track_id: Optional[int]
|
||||||
|
|
||||||
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?
|
||||||
poc_event_person_id: Optional[int] # 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]
|
code: Optional[str]
|
||||||
|
|
||||||
name: Optional[str]
|
name: Optional[str]
|
||||||
description: Optional[str]
|
description: Optional[str]
|
||||||
abstract: Optional[str]
|
abstract: Optional[str]
|
||||||
|
|
||||||
|
passcode: Optional[str] # = '7777777'
|
||||||
|
|
||||||
data_json: Optional[Json]
|
data_json: Optional[Json]
|
||||||
|
|
||||||
enable: Optional[bool]
|
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 redis_lookup_id_random(record_id_random=id_random, table_name='event_session')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@validator('poc_event_person_id', always=True)
|
# @validator('poc_event_person_id', always=True)
|
||||||
def poc_event_person_id_lookup(cls, v, values, **kwargs):
|
# def poc_event_person_id_lookup(cls, v, values, **kwargs):
|
||||||
log.setLevel(logging.WARNING)
|
# log.setLevel(logging.WARNING)
|
||||||
log.debug(locals())
|
# log.debug(locals())
|
||||||
|
|
||||||
if values['poc_event_person_id_random']:
|
# 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 redis_lookup_id_random(record_id_random=values['poc_event_person_id_random'], table_name='poc_event_person')
|
||||||
return None
|
# return None
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
underscore_attrs_are_private = True
|
underscore_attrs_are_private = True
|
||||||
@@ -173,11 +177,16 @@ class Event_Abstract_Base_New(Core_Std_Obj_Base):
|
|||||||
|
|
||||||
# event_track_id_random: Optional[str]
|
# 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]
|
description: Optional[str]
|
||||||
abstract: Optional[str]
|
abstract: Optional[str]
|
||||||
|
|
||||||
|
passcode: Optional[str]
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
underscore_attrs_are_private = True
|
underscore_attrs_are_private = True
|
||||||
allow_population_by_field_name = True
|
allow_population_by_field_name = True
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ async def post_event_abstract_obj(
|
|||||||
# create_sub_obj: bool = False,
|
# create_sub_obj: bool = False,
|
||||||
# fail_any: bool = True, # Fail if any thing goes wrong for sub objects
|
# 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_file_list: bool = False,
|
||||||
inc_event_person: bool = False,
|
inc_event_person: bool = False,
|
||||||
inc_event_presentation_list: 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?
|
# 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(
|
if create_event_abstract_obj_result := create_update_event_abstract_obj(
|
||||||
event_abstract_obj = event_abstract_obj,
|
event_abstract_obj = event_abstract_obj,
|
||||||
event_id = event_abstract_obj.event_id,
|
event_id = event_id, # event_abstract_obj.event_id,
|
||||||
event_person_id = event_abstract_obj.event_person_id,
|
event_person_id = event_person_id, # event_abstract_obj.event_person_id,
|
||||||
# create_sub_obj = create_sub_obj,
|
# create_sub_obj = create_sub_obj,
|
||||||
# fail_any = fail_any,
|
# fail_any = fail_any,
|
||||||
return_outline = False,
|
return_outline = False,
|
||||||
@@ -193,7 +193,7 @@ async def get_event_abstract_obj(
|
|||||||
# ### END ### API Event Abstract ### 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
|
# Updated 2023-03-22
|
||||||
@router.delete('/event/abstract/{event_abstract_id}', response_model=Resp_Body_Base)
|
@router.delete('/event/abstract/{event_abstract_id}', response_model=Resp_Body_Base)
|
||||||
def delete_event_abstract_obj(
|
def delete_event_abstract_obj(
|
||||||
@@ -222,4 +222,4 @@ def delete_event_abstract_obj(
|
|||||||
else:
|
else:
|
||||||
log.warning('Likely bad request')
|
log.warning('Likely bad request')
|
||||||
return mk_resp(data=False, status_code=400, response=response) # 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() ###
|
||||||
@@ -38,14 +38,14 @@ async def v4_post_event_person_obj_new(
|
|||||||
inc_user: bool = False,
|
inc_user: bool = False,
|
||||||
|
|
||||||
x_account_id: str = Header(...),
|
x_account_id: str = Header(...),
|
||||||
return_obj: bool = True,
|
return_obj: bool = False, # Should this default to False??? -2023-05-05
|
||||||
limit: int = 500,
|
limit: int = 500,
|
||||||
enabled: str = 'enabled',
|
enabled: str = 'enabled',
|
||||||
by_alias: bool = True,
|
by_alias: bool = True,
|
||||||
exclude_unset: bool = True,
|
exclude_unset: bool = True,
|
||||||
response: Response = Response,
|
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())
|
log.debug(locals())
|
||||||
|
|
||||||
# There should probably be a check for the event ID before calling the create function?
|
# There should probably be a check for the event ID before calling the create function?
|
||||||
|
|||||||
Reference in New Issue
Block a user