代码:
class Event(db.Model): __tablename__ = “events” title = db.Column(db.String(128), defaut = “”) |
出错:
File “/usr/share/nginx/html/SIPEvents/sipevents/models.py”, line 103, in Event title = db.Column(db.String(128), defaut = “”) File “/root/Envs/SIPEvents/lib/python2.7/site-packages/sqlalchemy/sql/schema.py”, line 1232, in __init__ “Unknown arguments passed to Column: ” + repr(list(kwargs))) sqlalchemy.exc.ArgumentError: Unknown arguments passed to Column: [‘defaut’] |
搜:
sqlalchemy.exc.ArgumentError: Unknown arguments passed to Column: [‘defaut’]
sqlalchemy Column defaut
python – marking columns in sqlalchemy tables – Stack Overflow
python – enforce column encoding with sqlalchemy – Stack Overflow
sqlalchemy Column 默认值
python – Setting a default value in sqlalchemy – Stack Overflow
Flask SQLAlchemy 表字段默认值 – 自由自我 – 51CTO技术博客
SQLAlchemy中设置Column的默认值 – Fisher的专栏 – 博客频道 – CSDN.NET
->后来才注意到,原来是笔误。应该是:
default
》
title = db.Column(db.String(128), default = “”) |
转载请注明:在路上 » [已解决]SQLAlchemy设置默认值出错:sqlalchemy.exc.ArgumentError: Unknown arguments passed to Column defaut