I'm trying to get a hashed password in a Postgresql DB using the select() and where() function in peewee, but I'm getting the class TypeError. The email is getting received from a json then decoded.
function:
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)
personmodel.Person:
class Person(basemodel.BaseExtModel):
email = TextField(primary_key=True)
password = TextField()
When I run print(hashed) this gets printed out:
<class 'lib.models.personmodel.Person'> SELECT "t1"."password" FROM "person" AS t1 WHERE ("t1"."email" = %s) ['correctemail@email.com']
When I run the query in Postico and it wont pass %s, but runs successfully when I delete the %s and put the email instead. Is there something incorrect with my parameters in the select and where functions?
Thanks in advance.