I am trying to make a many to many relation here in Flask-SQLAlchemy, but it seems that I don\'t know how to fill the \"many to many identifier database
To extend cowgills answer, you can also add multiple entries at once using extend:
extend
class_ = db.session.query(Class).first() new_students = db.session.query(Student).all() class_.students.extend(new_students) db.session.add(class_) db.session.commit()