Skip to content Skip to sidebar Skip to footer

Sqlalchemy Type Object 'date' Has No Attribute '_set_parent_with_dispatch'

I'm using sqlalchemy and simple model pattern. class Mail(Base): __tablename__ = 'mail' id = Column(Integer, primary_key=True) date = Column(Date, nulla

Solution 1:

Though your question doesn't appear to have this issue, a similar error can be caused by bad parameter ordering. Check the order of your variables in your Column(). If you have them out of order, you can get this error.

Hope that helps.

Solution 2:

No one answered this question with the answer above, so I will. This error can happen when you have inadvertently named one of your SQLAlchemy model mapper classes "Date" which causes a collision with SQLAlchemy's Date class.

Solution 3:

Solution 4:

you need to import a Date package.from sqlalchemy import Date

Post a Comment for "Sqlalchemy Type Object 'date' Has No Attribute '_set_parent_with_dispatch'"