希望你能帮我!
我在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 的事实。
这种消失的行为似乎是相当随机的。
任何对我如何调试它有任何线索的人都会有很大帮助!
谢谢。