這個問題困擾了我很長一段時間,我搜索了幾天,但仍不能解決它,包括this,this,和this。 下面的代碼返回一個查詢對象,它在選擇域中正確顯示。 但是,提交到數據庫時,發生錯誤。 # Query the user with Role.id == 4 as reviewer
def reviewer_choices():
return User.query.join(Use
我試圖創建兩個行爲不同的獨立管理頁面。 我已經成功地做了兩個單獨的管理頁面工作,但我似乎無法弄清楚如何設置第二個管理頁面的AdminIndexView。 class FlaskAdminIndexView(AdminIndexView):
@expose('/')
def index(self):
if not current_user.is_authenticat