我试图使用peewee中的select()和where()函数在Postgresql数据库中获取散列密码,但是得到了类TypeError。从json接收电子邮件,然后解码。你知道吗
功能:
person_decode = person_string.decode("UTF-8")
person_json = json.loads(person_decode)
personemail = person_json["email"]
hashed = personmodel.Person.select(personmodel.Person.password).where(personmodel.Person.email == personemail)
你知道吗人物模型人物地址:
class Person(basemodel.BaseExtModel):
email = TextField(primary_key=True)
password = TextField()
当我运行print(散列)时,它会被打印出来:
<class 'lib.models.personmodel.Person'> SELECT "t1"."password" FROM "person" AS t1 WHERE ("t1"."email" = %s) ['correctemail@email.com']
当我在Postico中运行查询时,它不会通过%s,但当我删除%s并放入电子邮件时,它会成功运行。在select和where函数中我的参数是否有错误?你知道吗
提前谢谢。你知道吗
如果你能把回溯错误包括进去,那会很有帮助的。事实上,不可能判断出哪里出了问题。你知道吗
相关问题 更多 >
编程相关推荐