Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currency field in many types has Union type which is so inconvenient #27

Open
GLEF1X opened this issue Jun 30, 2022 · 0 comments · May be fixed by #28
Open

Currency field in many types has Union type which is so inconvenient #27

GLEF1X opened this issue Jun 30, 2022 · 0 comments · May be fixed by #28
Assignees
Labels

Comments

@GLEF1X
Copy link
Owner

GLEF1X commented Jun 30, 2022

Example from source code

class AmountWithCurrency(Base):
    amount: float
    currency: Union[CurrencyModel, str]  # string if currency util couldn't parse it

For example, like here, user has to introspect currency field and find out whether it str or CurrencyModel. It seems to me that I'll implement this feature with help of python-iso4217 module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant