希望你能幫助我!自我參照關係消失在燒瓶管理員
我在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