今天实操flask连接mysql的,就短短几行代码,弄得头都大,大概没有打代码的天赋吧~~~~~
当我定义完这个模型类,跑程序
错误一:TypeError: column() got an unexpected keyword argument 'primary_key'
主键问题,于是我试着先把主键删掉,再跑程序又出现了
错误二:sqlalchemy.exc.ArgumentError: Mapper mapped class Author->author could not assemble any primary key columns for mapped table 'author'
我一直认为是mysql的包没安装对,又重新安装了一遍,结果还是不行,最后才发现自己太笨太笨了,columm中的C要大写
(注意大写)
一个大小写问题,就有一堆错,一定要细心细心细心!!!!
改完这个程序,我继续跑代码,好了&