Hey, I'm havin unexpected behaviour with bool:
packs = orm.select(
p for p in Pack if not p.nsfw
)
Results in
SELECT "p"."url", "p"."title", "p"."nsfw", "p"."owner_id", "p"."first_seen", "p"."last_crawled", "p"."sticker_count"
FROM "pack" "p"
WHERE ("p"."nsfw")::int = 0
Which doesn't seem to cover the not None=>True case.
For postgres it could be like this Stackoverflow:
SELECT * FROM table_name WHERE (boolean_column IS NULL OR NOT boolean_column)
Indeed, a python workaround is:
p for p in Pack if p.nsfw is True or p.nsfw is None
Hey, I'm havin unexpected behaviour with bool:
Results in
Which doesn't seem to cover the
not None=>Truecase.For postgres it could be like this Stackoverflow:
Indeed, a python workaround is: