I have a database schema (which i cannot change) with dates. they are defined as:
+---------------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+------------------+------+-----+---------+----------------+
| id | int(11) unsigned | NO | PRI | NULL | auto_increment |
...
| access_date | int(10) unsigned | NO | | 0 | |
+---------------------+------------------+------+-----+---------+----------------+
now, my model as this as defined:
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class logme(Base):
id_ = Column(Integer, primary_key=True)
...
access_date = Column(Integer, nullable=False, server_default=0)
When i load the model i get this error:
sqlalchemy.exc.ArgumentError: Argument 'arg' is expected to be one of type '<class 'str'>' or '<class 'sqlalchemy.sql.elements.ClauseElement'>' or '<class 'sqlalchemy.sql.elements.TextClause'>', got '<class 'int'>'
if I comment out the access_date everything works fine