📜  sqlalchemy.exc.ArgumentError:映射器映射类Students_of_teacher->students_of_teacher无法为映射表'students_of_teacher'组装任何主键列-无论代码示例

📅  最后修改于: 2022-03-11 14:55:07.800000             🧑  作者: Mango

代码示例1
Hi,
As the exception message says, sqlalchemy "could not assemble any primary key columns for mapped table 'users'". The sqlalchemy orm needs a primary key for each mapped table.
See https://docs.sqlalchemy.org/en/14/core/metadata.html#sqlalchemy.schema.Column.params.primary_key for how to set a primary key on a column