More again again again again. Moving ID random generation to the SQL db instead. General clean up.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from __future__ import annotations
|
||||
import datetime, hashlib, logging, os, pytz, redis, secrets
|
||||
import datetime, pytz
|
||||
|
||||
from typing import Dict, List, Optional, Set, Union
|
||||
from pydantic import BaseModel, EmailStr, Field, Json, PrivateAttr, ValidationError, validator
|
||||
@@ -10,6 +9,7 @@ from app.lib_general import log, logging
|
||||
from app.models.common_field_schema import base_fields, default_num_bytes
|
||||
|
||||
|
||||
# ### BEGIN ### API Activity Log Models ### Activity_Log_Base() ###
|
||||
class Activity_Log_Base(BaseModel):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
@@ -17,7 +17,6 @@ class Activity_Log_Base(BaseModel):
|
||||
id_random: Optional[str] = Field(
|
||||
**base_fields['activity_log_id_random'],
|
||||
alias = 'activity_log_id_random',
|
||||
default_factory = lambda:secrets.token_urlsafe(default_num_bytes),
|
||||
)
|
||||
id: Optional[int] = Field(
|
||||
alias = 'activity_log_id'
|
||||
@@ -124,5 +123,4 @@ class Activity_Log_Base(BaseModel):
|
||||
underscore_attrs_are_private = True
|
||||
allow_population_by_field_name = True
|
||||
fields = base_fields
|
||||
|
||||
#Activity_Log_Base.update_forward_refs()
|
||||
# ### END ### API Activity Log Models ### Activity_Log_Base() ###
|
||||
|
||||
Reference in New Issue
Block a user