1
我必须使用新的PostgreSQL HSTORE支持加入到SQLAlchemy的0.8的模型:如何在金字塔中使用SQLAlchemy HSTORE?
class Gateway(Base):
__tablename__ = 'gateway'
id = Column(Integer, primary_key=True)
access = Column(Mutable.as_mutable(HSTORE), nullable=False, unique=True)
但是当我运行session.query(Gateway).all()
,以下异常引发:
ValueError: Attribute 'access' does not accept objects of type <type 'dict'>
你能帮我解决这个问题?
这是什么sqlalchemy版本? 0.7,0.8? – 2013-02-20 13:05:30
SQLAlchemy 0.8.0b2 – uralbash 2013-02-20 14:07:15
你应该真的包含一个完整的回溯,而不仅仅是异常本身。 – 2013-02-20 14:44:55