当我单击父表视图的显示按钮时,它应该引用子表视图并显示所有外键数据
def _link_formatter(view, context, model, name):
link = "<a target='_blank' href='%s' style='margin-left:10px'>%s</a>" % (
url_for('child_table.index_view', child_id=model.id, url=url_for('child_table.index_view')), "Show Data"
)
return Markup(link)
column_formatters = {
'url': _link_formatter
}
URL的构建方式如下:
http://0.0.0.0/admin/child_table/?child_id=184&url=%2Fadmin%child_table%2F