sqlalchemy.exc.ArgumentError: secondary argument <class ‘orm框架.model.models.StudentTohobby’> passed to to relationship() Hobby.srelate_many_hobby must be a Table object or other FROM clause; can’t send a mapped class directly as rows in ‘secondary’ are persisted independently of a class that is mapped to that same table.
多对多可以在任意一个类中加relationship(secondary="");
将secondary 参数改成对应 tablename 值就可以了不要写对应的model类;