I'd like to run a query for a user based on username or email address.
I must be missing it, but I can't find how to run an OR
query in the peewee documentation. How do you do that?
From the documentation
If you want to express a complex query, use parentheses and python’s bitwise or and and operators:
>>> Tweet.select().join(User).where(
... (User.username == 'Charlie') |
... (User.username == 'Peewee Herman')
... )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With