fix: replace integer comparisons on boolean fields with True/False (#69) #94

Merged
cal merged 1 commits from issue/69-boolean-fields-compared-as-integers-sqlite-pattern into main 2026-04-08 03:57:36 +00:00
2 changed files with 10 additions and 10 deletions

View File

@ -513,12 +513,12 @@ class Team(BaseModel):
all_drops = Transaction.select_season(Current.latest().season).where( all_drops = Transaction.select_season(Current.latest().season).where(
(Transaction.oldteam == self) (Transaction.oldteam == self)
& (Transaction.week == current.week + 1) & (Transaction.week == current.week + 1)
& (Transaction.cancelled == 0) & (Transaction.cancelled == False)
) )
all_adds = Transaction.select_season(Current.latest().season).where( all_adds = Transaction.select_season(Current.latest().season).where(
(Transaction.newteam == self) (Transaction.newteam == self)
& (Transaction.week == current.week + 1) & (Transaction.week == current.week + 1)
& (Transaction.cancelled == 0) & (Transaction.cancelled == False)
) )
for move in all_drops: for move in all_drops:
@ -596,12 +596,12 @@ class Team(BaseModel):
all_drops = Transaction.select_season(Current.latest().season).where( all_drops = Transaction.select_season(Current.latest().season).where(
(Transaction.oldteam == sil_team) (Transaction.oldteam == sil_team)
& (Transaction.week == current.week + 1) & (Transaction.week == current.week + 1)
& (Transaction.cancelled == 0) & (Transaction.cancelled == False)
) )
all_adds = Transaction.select_season(Current.latest().season).where( all_adds = Transaction.select_season(Current.latest().season).where(
(Transaction.newteam == sil_team) (Transaction.newteam == sil_team)
& (Transaction.week == current.week + 1) & (Transaction.week == current.week + 1)
& (Transaction.cancelled == 0) & (Transaction.cancelled == False)
) )
for move in all_drops: for move in all_drops:
@ -679,12 +679,12 @@ class Team(BaseModel):
all_drops = Transaction.select_season(Current.latest().season).where( all_drops = Transaction.select_season(Current.latest().season).where(
(Transaction.oldteam == lil_team) (Transaction.oldteam == lil_team)
& (Transaction.week == current.week + 1) & (Transaction.week == current.week + 1)
& (Transaction.cancelled == 0) & (Transaction.cancelled == False)
) )
all_adds = Transaction.select_season(Current.latest().season).where( all_adds = Transaction.select_season(Current.latest().season).where(
(Transaction.newteam == lil_team) (Transaction.newteam == lil_team)
& (Transaction.week == current.week + 1) & (Transaction.week == current.week + 1)
& (Transaction.cancelled == 0) & (Transaction.cancelled == False)
) )
for move in all_drops: for move in all_drops:

View File

@ -78,14 +78,14 @@ async def get_transactions(
transactions = transactions.where(Transaction.player << these_players) transactions = transactions.where(Transaction.player << these_players)
if cancelled: if cancelled:
transactions = transactions.where(Transaction.cancelled == 1) transactions = transactions.where(Transaction.cancelled == True)
else: else:
transactions = transactions.where(Transaction.cancelled == 0) transactions = transactions.where(Transaction.cancelled == False)
if frozen: if frozen:
transactions = transactions.where(Transaction.frozen == 1) transactions = transactions.where(Transaction.frozen == True)
else: else:
transactions = transactions.where(Transaction.frozen == 0) transactions = transactions.where(Transaction.frozen == False)
transactions = transactions.order_by(-Transaction.week, Transaction.moveid) transactions = transactions.order_by(-Transaction.week, Transaction.moveid)