Changing hosted_file_link field names.

This commit is contained in:
Scott Idem
2021-06-18 09:58:31 -04:00
parent 6d4463e57e
commit bb2f14b67c
4 changed files with 46 additions and 36 deletions

View File

@@ -69,17 +69,17 @@ class Hosted_File_Link_Base(BaseModel):
return redis_lookup_id_random(record_id_random=values['account_id_random'], table_name='account')
return None
@validator('object_id', always=True)
def object_id_lookup(cls, v, values, **kwargs):
@validator('link_to_id', always=True)
def link_to_id_lookup(cls, v, values, **kwargs):
log.setLevel(logging.WARNING)
log.debug(locals())
if values['object_id_random'] and values['object_type']:
return redis_lookup_id_random(record_id_random=values['object_id_random'], table_name=values['object_type'])
if values['link_to_id_random'] and values['link_to_type']:
return redis_lookup_id_random(record_id_random=values['link_to_id_random'], table_name=values['link_to_type'])
return None
class Config:
underscore_attrs_are_private = True
fields = base_fields
Hosted_File_Base.update_forward_refs()
Hosted_File_Link_Base.update_forward_refs()