db = pymysql.connect("localhost","testuser","test123","TESTDB" )
class User(Model):
username = CharField()
class Meta:
database = db
用这种方式报 connection 没有 compiler 这个错
1
stamaimer 2016-11-22 11:25:12 +08:00 via iPhone
peewee 是个 orm , pymysql 是个 db driver ,难道不应该是 peewee 通过 pymysql 链接 mysql 吗? http://docs.peewee-orm.com/en/latest/peewee/database.html
|
2
cheetah 2016-11-22 11:31:18 +08:00
|
3
cheetah 2016-11-22 11:31:53 +08:00
|