-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: simply Price.currency validation (#67)
* Replace sqlalchemy_utils CurrencyType by custom CurrencyEnum * Rename LocationOSMType to LocationOSMEnum
- Loading branch information
Showing
4 changed files
with
18 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
from enum import Enum | ||
|
||
from babel.numbers import list_currencies | ||
|
||
class LocationOSMType(Enum): | ||
CURRENCIES = [(currency, currency) for currency in list_currencies()] | ||
|
||
CurrencyEnum = Enum("CurrencyEnum", CURRENCIES) | ||
|
||
|
||
class LocationOSMEnum(Enum): | ||
NODE = "NODE" | ||
WAY = "WAY" | ||
RELATION = "RELATION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters