-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
self.tbl在mysql.py中没有定义 #1
Comments
运行后将打印出'tiger'
执行select order from user 就会报错,执行select
当然表user在创建时,字段order也被返单引号括起来的。 |
第二个问题明白了,感谢解惑!
我这里self.tbl和self.conn都会提醒Unresolved attribute reference 'tbl'('conn') for class 'Model' |
哦哦,class Model,我是这样使用的,所以没有发现你说的报错。但直接调用Model的话,确实会报错的,后续我修复一下你说的这个bug,感谢
|
huajiao.py中使用了Model类,但是我这却导不进来,我用的Python3.6,官方自带的mysql模块 |
没看到你在mysql.py这个文件中定义self.tbl就直接在48行使用了。
另外,Model类中的select方法,没有必要对例如select_str = '123, abc' 中的逗号进行处理吧,可以直接用select 123, abc from tbl。为什么非要用select '123', 'abc' from tbl呢?
请大神指点一二,谢谢!
The text was updated successfully, but these errors were encountered: