【发布时间】:2020-01-08 17:11:01
【问题描述】:
如何使用 peewee python orm 设置 TextField 的密钥长度。我在 python3.7 上,我收到此错误消息:
peewee.InternalError: (1170, "BLOB/TEXT column 'text' used in key specification without a key length")
我尝试这样指定它:
text = TextField(unique = True, key_length = 255, index = True)
但是这似乎不起作用,因为它返回了这个:
TypeError: __init__() got an unexpected keyword argument 'key_length'
【问题讨论】:
标签: python python-3.x orm mysql-python peewee