Relative Content

Tag Archive for pythonflaskflask-admin

Editing Exclusive Boolean Field in Flask-Admin Views

I have a Flask-Admin view where I want a boolean field (is_first) to behave exclusively, meaning only one entry can be set as True while others are False. To achieve this, I’ve converted it into a radio button format within the view UI, as shown in the image below:

Pulling Current List From Database in Flask-Admin Form

I have a database named Account and I want to list the Account records of the current user in a select list in this database. But this list must be up to date and list all Accounts currently available. But the code I wrote does not work that way. For example, I add an Account, but I have to close and reopen the script for it to appear up to date. if I don’t do this the accounts are never listed. How can I solve this problem?