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
Refactor get_field_info method to include max_digits and decimal_places attributes in SimpleMetadata class #8943
Refactor get_field_info method to include max_digits and decimal_places attributes in SimpleMetadata class #8943
Conversation
…es attributes in SimpleMetadata class
rest_framework/metadata.py
Outdated
@@ -124,7 +124,8 @@ def get_field_info(self, field): | |||
attrs = [ | |||
'read_only', 'label', 'help_text', | |||
'min_length', 'max_length', | |||
'min_value', 'max_value' | |||
'min_value', 'max_value', | |||
'max_digits', 'decimal_places', |
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.
you need tests to avoid regression
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.
Done.
interestingly the CI tests are not running now |
Do I have to do anything special? |
we need some work to fix the codecov issue in the CI first |
OK, thanks, |
I think the CI problem is fixed... |
yup seems to be released again https://pypi.org/project/codecov/#history |
Could you tell me if this pull request has been merged or not? |
Refactor get_field_info method to include max_digits and decimal_places attributes in SimpleMetadata class
Description
This commit adds the max_digits and decimal_places attributes to the list of attributes included in the get_field_info method of the SimpleMetadata class in the Django Rest Framework. These attributes provide additional information about decimal fields, which was not previously included in the metadata. By adding these attributes to the output of the method, clients consuming the API will have more complete information about the fields in the serialized data, allowing them to make more informed decisions about how to interact with the API. This change was made in response to user feedback and is not expected to have any negative impact on existing functionality.
before change
after change