例如這兩個(gè)modelclass A(Model):
id = Column(Integer, primary_key=True)
b = relationship('B', backref='a')
class B(Model):
id = Column(Integer, primary_key = True)
a_id = Column(Interger, ForeignKey = "A.id")class aAdmin(ModelView):
column_list = ('id', 'b.id')admin.add_view(aAdmin(A, db.session))
1 回答

蝴蝶刀刀
TA貢獻(xiàn)1801條經(jīng)驗(yàn) 獲得超8個(gè)贊
inline_models
inline_models = [(B, dict(form_columns=['id', 'a_id']))]
添加回答
舉報(bào)
0/150
提交
取消