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

This commit is contained in:
Scott Idem
2022-06-30 15:43:00 -04:00
parent 493f4a7365
commit c43e958859
9 changed files with 26 additions and 34 deletions

View File

@@ -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
@@ -12,6 +11,7 @@ from app.models.person_models import Person_Base
from app.models.user_models import User_Base
# ### BEGIN ### API Post Comment Models ### Post_Comment_Base() ###
class Post_Comment_Base(BaseModel):
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
@@ -19,7 +19,6 @@ class Post_Comment_Base(BaseModel):
id_random: Optional[str] = Field(
**base_fields['post_comment_id_random'],
alias = 'post_comment_id_random',
default_factory = lambda:secrets.token_urlsafe(default_num_bytes),
)
id: Optional[int] = Field(
#alias = 'post_comment_id'
@@ -101,3 +100,4 @@ class Post_Comment_Base(BaseModel):
underscore_attrs_are_private = True
allow_population_by_field_name = True
fields = base_fields
# ### END ### API Post Comment Models ### Post_Comment_Base() ###