More again again again. Moving ID random generation to the SQL db instead. General clean up.

This commit is contained in:
Scott Idem
2022-06-30 17:00:17 -04:00
parent 8a77f0c892
commit 5066cd099d
15 changed files with 56 additions and 56 deletions

View File

@@ -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
@@ -15,6 +15,7 @@ from app.models.event_presenter_models import Event_Presenter_Base
from app.models.person_models import Person_Base
# ### BEGIN ### API Event Presentation Models ### Event_Presentation_Base() ###
class Event_Presentation_Base(BaseModel):
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
@@ -22,7 +23,6 @@ class Event_Presentation_Base(BaseModel):
id_random: Optional[str] = Field(
**base_fields['event_presentation_id_random'],
alias = 'event_presentation_id_random',
default_factory = lambda:secrets.token_urlsafe(default_num_bytes),
)
id: Optional[int] = Field(
alias = 'event_presentation_id'
@@ -145,3 +145,4 @@ class Event_Presentation_Base(BaseModel):
underscore_attrs_are_private = True
allow_population_by_field_name = True
fields = base_fields
# ### END ### API Event Presentation Models ### Event_Presentation_Base() ###