希望你能帮助我!自我参照关系消失在烧瓶管理员
我在SQLAlchemy的关系如下:
class Location(db.Model, DateModified, Sluggable):
__tablename__ = 'location'
__sluggable__ = {
'populate_from': 'title',
'always_update': True
}
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(80))
...
parent_location_id = db.Column(db.Integer, db.ForeignKey('location.id'), index=True)
parent_location = db.relationship(lambda: Location, remote_side=id, backref='child_locations')
我为如何调试间歇瓶管理员或SQLAlchemy的是失去了parent_location_id在保存父位置其实真的不确定。
这消失的行为似乎是相当随机的。
任何人有任何线索,我如何调试这将帮助极大!
谢谢。
有一棵树的SQLAlchemy示例 - 它也发生在那里吗? – Joes 2014-09-14 07:48:02