I'm trying to return results that have a particular phrase or word in a textfield of a particular item in a Sqlite database using peewee.
My current attempt has been:
for key in listOfKeys:
foundPun = models.Pun.select().where(key in str(models.Pun.keywords)).get()
click.echo('-'*10)
click.echo(foundPun.pun)
click.echo('-'*10)
Which returns the error:
AttributeError: 'bool' object has no attribute 'clone'
For reference, this is the Pun model:
class Pun(Model):
pun = TextField()
keywords = TextField(default="")
tags = TextField(default="")
class Meta:
database = db
Is this even the right way to go about searching for results in peewee?
Any help or pointing me in the right direction is massively appreciated!