8000 Fix: convert valid datetime strings to Python datetime objects in build_query by SwAt1563 · Pull Request #674 · jowilf/starlette-admin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: convert valid datetime strings to Python datetime objects in build_query #674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SwAt1563
Copy link

@SwAt1563
Copy link
Author

Hey @jowilf , could you please take a look at this when you have a moment?

98E2
@@ -49,6 +51,24 @@ def __is_not_null(latest_attr: InstrumentedAttribute) -> Any:
}


def parse_datetime(value: str) -> bool:
try:
TypeAdapter(datetime.datetime).validate_python(value)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will require the SQLAlchemy user to install Pydantic, which I think is unnecessary. Can you use the built-in datetime library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0