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

Centralize data validation in the Data model #8

Closed
math-a3k opened this issue Jan 30, 2021 · 1 comment
Closed

Centralize data validation in the Data model #8

math-a3k opened this issue Jan 30, 2021 · 1 comment
Assignees

Comments

@math-a3k
Copy link
Owner

Currently there are the same validations done in the DataInputForm and the DataInputSerializer regarding percentage fields.

To avoid this duplication - which may pose a future problem - these should be done at a Model level.

The idea is define a 'main' field - those in Data.HEMOGRAM_FIELDS - and record also fields expressing the same of the 'main' field but in other unit, which will populate the 'main' accordingly. Perhaps Data.CONVERSION_FIELDS?

This wouldn't be a problem for the classifier, as for django_ai you have to select which fields to use in DataColumns; but the CSV output, table output, data detail and REST API output would need to be adjusted to not show Data.CONVERSION_FIELDS

@math-a3k math-a3k self-assigned this Jan 30, 2021
@math-a3k
Copy link
Owner Author

math-a3k commented Feb 1, 2021

Implemented in 15eeb79 (this issue is related to #3 and some how #6)

@math-a3k math-a3k closed this as completed Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant