Added new route, methods, and models for data_store. Also minor code clean up and less debug.

This commit is contained in:
Scott Idem
2022-03-11 17:12:55 -05:00
parent 57e3298dc6
commit 90d7619966
8 changed files with 608 additions and 18 deletions

View File

@@ -23,6 +23,7 @@ class Event_Device_Base(BaseModel):
id: Optional[int] = Field(
alias = 'event_device_id'
)
account_id_random: Optional[str]
account_id: Optional[int]
@@ -79,9 +80,6 @@ class Event_Device_Base(BaseModel):
@validator('id', always=True)
def event_device_id_lookup(cls, v, values, **kwargs):
log.setLevel(logging.WARNING)
log.debug(locals())
if isinstance(v, int) and v > 0: return v
elif id_random := values.get('id_random'):
return redis_lookup_id_random(record_id_random=id_random, table_name='event_device')
@@ -89,9 +87,6 @@ class Event_Device_Base(BaseModel):
@validator('account_id', always=True)
def account_id_lookup(cls, v, values, **kwargs):
log.setLevel(logging.WARNING)
log.debug(locals())
if isinstance(v, int) and v > 0: return v
elif id_random := values.get('account_id_random'):
return redis_lookup_id_random(record_id_random=id_random, table_name='account')
@@ -99,9 +94,6 @@ class Event_Device_Base(BaseModel):
@validator('event_id', always=True)
def event_id_lookup(cls, v, values, **kwargs):
log.setLevel(logging.WARNING)
log.debug(locals())
if isinstance(v, int) and v > 0: return v
elif id_random := values.get('event_id_random'):
return redis_lookup_id_random(record_id_random=id_random, table_name='event')
@@ -109,9 +101,6 @@ class Event_Device_Base(BaseModel):
@validator('event_location_id', always=True)
def event_location_id_lookup(cls, v, values, **kwargs):
log.setLevel(logging.WARNING)
log.debug(locals())
if isinstance(v, int) and v > 0: return v
elif id_random := values.get('event_location_id_random'):
return redis_lookup_id_random(record_id_random=id_random, table_name='event_location')