This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydantic import BaseModel, root_validator | |
# NOTE: this works (for me) with pydantic==1.10.13, | |
# but we'll be upgrading to v2 and you can do the same | |
# thing with the model_validator | |
# considerations: | |
# - I'm using this in FastAPI, mostly read-only to my users, | |
# so I don't have a need to keep the ObjectId, and convert | |
# back to the bson ObjectId as-needed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ltom = { | |
"A" : ".-", | |
"B" : "-...", | |
"C" : "-.-.", | |
"D" : "-..", | |
"E" : ".", | |
"F" : "..-.", | |
"G" : "--.", | |
"H" : "....", | |
"I" : "..", |