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

change models to use friendlier names for init #22

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

mochic
Copy link
Collaborator

@mochic mochic commented Jul 23, 2024

Uses populate_by_name, serialization_alias, and validation_alias to create more friendly names for SlimsBaseModel when initializing a new model from model constructor.

@mochic mochic requested a review from patricklatimer July 23, 2024 06:20
Copy link
Collaborator

@patricklatimer patricklatimer left a comment

Choose a reason for hiding this comment

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

As discussed, this makes the code look a little uglier, requiring both validation_alias and serialization_alias, but there's currently not a great way around that with Pydantic and it definitely makes the interface significantly better.

@mochic mochic merged commit e7375ce into main Jul 23, 2024
3 checks passed
@mochic mochic deleted the enh/friendlier-model-names branch July 23, 2024 22:14
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.

2 participants