-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Changing date format #119
Comments
Not at all sure what you're trying to do. Please explain a little more. |
Give the input and expected output. |
@samuelcolvin I use pydantic to validate user request data for my api. I wan't my api to accept another format for dates. Like "%d.%m.%Y" instead of "%Y-%m-%d". So "23.10.2013" would be a valid date and would be converted to datetime.date. |
Thanks for reporting the solution here is to fix it properly in pydantic, see #122 |
* avoid creating unnecessary strings * more Cow usage * tweaks and cleanup * tweaks to models
What is the right way to do it? I used some monkeypatch:
but it feels rather hacky. Looks like I can do it with validators but when I return something It still tries to create date from string after that when it's not a string anymore.
I get:
The text was updated successfully, but these errors were encountered: