-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Accept display options for MathesarMoney type #1205
Conversation
…s are according to the requirements
…the currency code
…h missing currency_code Add test cases for currency with unknown currency_code
# Conflicts: # mathesar/tests/api/test_table_api.py
…on' into mathesar-1105-money-display-option
Blocked by #1335 |
…ayOptionSerializer`
…y-option # Conflicts: # mathesar/tests/api/test_column_api.py
# Conflicts: # mathesar/tests/api/test_column_api.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at the diff at all here. (It's kind of baffling to me that so many changes would be required for what seems like a relatively limited addition to the API, so I haven't even bothered to try understanding what's going on under the hood.)
I did verify that the API is working as I need it to work though.
The following display options, seem to work well according to these recent and somewhat ad-hoc specs:
number_format
currency_symbol
currency_symbol_location
And that's all I need in order to continue working on #259, so I'd like to get this merged.
But I'll hold off on merging until we get a proper backend review.
@seancolsen Most of the complexity here is because money has required display options that we need to set from the backend. If we infer a column in a CSV as I've assigned @mathemancer to review this since it touches type casting logic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good. Let's get it merged!
Ach, it has merge conflicts. @silentninja Go ahead and merge after resolving those. |
Fixes #1105 by adding display options support for
MathesarMoney
type.Features List
The frontend should be able to set any of these display options.
mathesar.tests.api.test_column_api.test_column_create_display_options
The frontend should know what the choices are for any display option that supports a set of choices.
mathesar.tests.api.test_ui_types_api.test_type_list
mathesar.api.display_options.money_display_options_schema
The display options should be validated.
mathesar.tests.api.test_column_api.test_column_create_wrong_display_options
If any of the display options end up changing other display options, the backend should handle that.
When we infer a column as a money type, we should set the display options for that column based on the currency symbols in the original CSV/other file.
mathesar.tests.display_options_inference.test_money.test_display_options_inference
Additional fix
Checklist
Update index.md
).master
branch of the repositoryvisible errors.
Developer Certificate of Origin
Developer Certificate of Origin