I have a Model created in my Flask app that inherits from from flask_appbuilder import Model
& now I want to query the Model data to get a specific record using something like MyModel.query.get(id='someid')
which used to work with Flask-SQLAlchemy Model Class but does not seem to work with the Flask AppBuilder's Model Class. So I'm looking for an equivalent alternative through which I can query a db Model that inherits Model from from flask_appbuilder import Model
Asked
Active
Viewed 544 times
0

shouryaveer
- 11
- 3
1 Answers
1
You can access it as follows :-
result = db.session.query(MODELNAME).filter_by(id=someid).all()
return str(result)

Lenin
- 303
- 2
- 3