Flask-AppBuilder
Flask-AppBuilder copied to clipboard
select record to filter another view
Environment
Flask-Appbuilder version: 4.1.1
Expected results
I'd like to define an action in MyViewA (I followed this doc ) to filter another view MyViewB. To create the filter i used this doc.
models.py example
class TableA(Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100))
class TableB(Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100))
id_a = db.Column(db.ForeignKey('tablea.id'), index=True)
tablea = relationship('TableA', primaryjoin='TableB.id_a == TableA.id')
I need to create a view of TableA with an action on record selection that redirect on the view of TableB with a filter like
base_filters = [['id_a',FilterEqual, THE_ID_OF_THE_RECORD_SELECTED],]
Thanks in advance
Have a look at "related_views". I think that's it what are you looking for. https://flask-appbuilder.readthedocs.io/en/latest/quickhowto.html