SQLAlchemy默认DateTime
这是我的声明性模型: import datetime from sqlalchemy import Column, Integer, DateTime from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Test(Base): __tablename__ = 'test' id = Column(Integer, primary_key=True) created_date = DateTime(default=datetime.datetime.utcnow) 但是,当我尝试导入此模块时,出现此错误: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "orm/models2.py", line 37, in <module> class Test(Base): File "orm/models2.py", …