How to create relationship many to many in SQLAlchemy (python, flask) for model User to itself

前端 未结 3 991
星月不相逢
星月不相逢 2021-01-06 11:22

I need to create a table called friends, it should looks like:

friends:

  • user_id
  • friend_id

I w

3条回答
  •  春和景丽
    2021-01-06 11:52

    Miguel Grinberg's tutorial explain this type of application.

    http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-viii-followers-contacts-and-friends

提交回复
热议问题