I have tables similar to the following:
class User(Base):
id = Column(Integer, primary_key=True)
name = Column(String(255, unique=True)
class Document(Base):
id = Column(Integer, primary_key=True)
name = Column(String(255, unique=True)
customer_id = Column(ForeignKey('User.id'))
I would like to list Users in Flask-Admin's ModelView (sqla) together with number of documents they have created (func.count(Document)). Is there some possibility to achieve it using SqlAlchemy and standard Flask-Admin ModelView, without specifying custom SQL query?