More again again again. Moving ID random generation to the SQL db instead. General clean up.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
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 +10,7 @@ from app.models.common_field_schema import base_fields, default_num_bytes
|
||||
from app.models.hosted_file_models import Hosted_File_Base
|
||||
|
||||
|
||||
# ### BEGIN ### API Event File Models ### Event_File_Base() ###
|
||||
class Event_File_Base(BaseModel):
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
@@ -17,7 +18,6 @@ class Event_File_Base(BaseModel):
|
||||
id_random: Optional[str] = Field(
|
||||
**base_fields['event_file_id_random'],
|
||||
alias = 'event_file_id_random',
|
||||
default_factory = lambda:secrets.token_urlsafe(default_num_bytes),
|
||||
)
|
||||
id: Optional[int] = Field(
|
||||
alias = 'event_file_id'
|
||||
@@ -192,3 +192,4 @@ class Event_File_Base(BaseModel):
|
||||
underscore_attrs_are_private = True
|
||||
allow_population_by_field_name = True
|
||||
fields = base_fields
|
||||
# ### END ### API Event File Models ### Event_File_Base() ###
|
||||
|
||||
Reference in New Issue
Block a user