Skip to content

Commit

Permalink
Pass decimal args directly to ConstrainedField
Browse files Browse the repository at this point in the history
SQLModel fork adds them as arguments to Field to avoid schema_extra
  • Loading branch information
klane committed Jun 27, 2022
1 parent c71bac6 commit 01d2a26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions databall/db/tables/covers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ class Covers(Base, GameID, table=True):
ge=-30,
le=30,
multiple_of=0.5,
schema_extra={'max_digits': 3, 'decimal_places': 1},
max_digits=3,
decimal_places=1,
)
home_spread_result: SpreadResult = EnumField(use_values=True)
over_under: Decimal = ConstrainedField(
name='over_under',
ge=100,
le=300,
multiple_of=0.5,
schema_extra={'max_digits': 4, 'decimal_places': 1},
max_digits=4,
decimal_places=1,
)
over_under_result: OverUnderResult = EnumField(use_values=True)

Expand Down

0 comments on commit 01d2a26

Please sign in to comment.