You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 7, 2023. It is now read-only.
@@ -84,8 +86,6 @@ class LogItemIncoming(BaseModel):
84
86
"""
85
87
86
88
# FIXME: Use max lengths for strings based on the actual lengths from the database using `Pydantic constraints <https://pydantic-docs.helpmanual.io/usage/types/#constrained-types>`_. Is there any way to query the database for these, instead of manually keeping them in sync?
87
-
#
88
-
# Even better, we should introspect the database and auto-convert this to Pydantic. See the idea at https://github.com/tiangolo/pydantic-sqlalchemy/blob/master/pydantic_sqlalchemy/main.py. See also https://github.com/kolypto/py-sa2schema. Other ideas: https://docs.sqlalchemy.org/en/14/core/reflection.html,
89
89
event: str
90
90
act: str
91
91
div_id: str
@@ -107,19 +107,30 @@ class LogItem(LogItemIncoming):
107
107
This may seem like overkill but it illustrates a point. The schema for the incoming log data will not contain a timestamp. We could make it optional there, but then that would imply that it is optional which it most certainly is not. We could add timestamp as part of a LogItemCreate class similar to how password is handled in the tutorial: https://fastapi.tiangolo.com/tutorial/sql-databases/ But there is no security reason to exclude timestamp. So I think this is a reasonable compromise.
0 commit comments