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

2714 required fields #2776

Merged
merged 4 commits into from
Jul 20, 2022
Merged

2714 required fields #2776

merged 4 commits into from
Jul 20, 2022

Conversation

iamleeg
Copy link
Contributor

@iamleeg iamleeg commented Jul 20, 2022

Users can indicate that a custom field is required: this will change the validation rules such that a case is invalid if it doesn't provide a value for the specified field. As such, users must also supply an initial default value for the field, which will be applied to existing cases.

Required fields must have a default value, to be applied to existing cases (which by definition have yet to receive a value for this now-required field
fields is a list of dataclass fields that should be added to the generated class.
field_models is a list of model objects describing the fields for the data dictionary
and for validation."""
# FIXME generate the fields list from the field_models
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my plan for this is when the day zero schema is committed, to create a list of Field objects that contain the day zero fields and get played into the Case class; then the logic for make_custom_case_class is simply to take a list of all known Fields and make data class fields for them. At that point I think the DayZeroCase intermediate class goes away.

@iamleeg iamleeg merged commit 7758dfa into main Jul 20, 2022
@iamleeg iamleeg deleted the 2714_required_fields branch July 20, 2022 15:30
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

Successfully merging this pull request may close these issues.

None yet

2 participants