Skip to content
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

datetime.datetime.utc is deprecated in python 3.12 #436

Open
chrisroat opened this issue Aug 18, 2024 · 0 comments
Open

datetime.datetime.utc is deprecated in python 3.12 #436

chrisroat opened this issue Aug 18, 2024 · 0 comments

Comments

@chrisroat
Copy link

The following line gives an error:

created_at = Column(DateTime, default=datetime.utcnow, nullable=False)

When this was originally written, was there a reason to pass a python function instead of sqlalchemy func, like the following?

from sqlalchemy.sql import func
...
created_at = Column(DateTime, default=func.now(), nullable=False) 

(or even using server_default instead, but that requires a schema change to implement now)

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

No branches or pull requests

1 participant