Answer the question
In order to leave comments, you need to log in
How to make nested tables in flask-admin?
I have a model
class User(Base):
__tablename__ = 'user'
id = Column(Integer, primary_key=True)
name = Column(String(100))
group_id = Column(Integer, ForeignKey('group.id'))
group = relationship( " Group", back_populates="user" )
class Group(Base):
__tablename__ = 'group'
id = Column(Integer, primary_key=True)
name = Column(String(100))
user = relationship( 'User', back_populates=' group', lazy=True )
admin = Admin(app, name='microblog', template_mode='bootstrap3')
admin.add_view(ModelView(User, db_session))
admin.add_view(ModelView(Group, db_session))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question