我描述了一种小淘气的模型:
class Products(peewee.Model):
article = peewee.CharField(primary_key=True)
name = peewee.CharField()
price = peewee.FloatField()
price_distributor = peewee.FloatField()
price_discount = peewee.FloatField()
class Meta:
database = get_db_connection()然后尝试插入以下数据:
row = {
'article': row[0].value,
'name': row[1].value,
'price': row[2].value,
'price_distributor': row[3].value,
'price_discount': row[4].value
}
# Insert
Products.insert(row)它不会产生任何错误,只是数据库是空的。
发布于 2017-11-16 21:49:12
之后需要调用.execute()。相同的更新和删除。
https://stackoverflow.com/questions/47339561
复制相似问题