I'm really struggling to use flask_admin at the moment. I am trying to set up a
dashboard that displays some kind of "job board" where an admin can click on one
item to submit a response to user (where the user has submitted an answer to a
question). I've looked through the documentation a few times but I just can't wrap
my head around anything. I'd like the dashboard to just appear on the basic /admin
route, but I also dont know how to allow this route to take multiple (or even one)
of the database models
I have flask_admin set up at the moment to just do the usual CRUD operations on the
database using admin.add_view(...), but editing quizzes through here obviously
doesn't look great and has too many options for simply responding to an answer.
I'm pretty sure what I need to know is how to properly use @expose() within
different views, but I can't seem to do what I want so I may need more info.
Thanks for any help
I'm currently trying to initialise and add views to my flask admin. I'm struggling with
where to put the admin.add_view(modelview...).
I have the following code in my __init__.py;
app.config['FLASK_ADMIN_SWATCH'] = 'cerulean'
admin = Admin(app, name='GameFinder', template_mode='bootstrap3')
and cant figure out where to put;
All the tutorials I can find online have their applications made from one file, so
separating these while keeping the User and Post classes accessible and the admin object is
Any help or pointers in the right direction would be appreciated.
If anyone is struggling to do the same, I solved this by importing the already made classes at the
bottom of __init__.py;
##initialisation code above##
from flask_admin.contrib.sqla import ModelView
from app.models import User, Post
admin.add_view(ModelView(User, db.session))admin.add_view(ModelView(Post, db.session))