-
Notifications
You must be signed in to change notification settings - Fork 5
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
Towards pydantic dataclass #210
Conversation
... for some models in order to simplify instantiation of the objects.
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 see nothing bad here. I think you've found the best way yet.
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.
One minor doc error to correct.
I like the approach. We could at some point extend pydantic.base_model to include the get_field_names
method so it is usable everywhere. pre_root
is almost general, but still knows about the sqlalchemy table it maps to. Do you think we can meaningfully have a table-mapping pre_root
that can do the job for any sqlalchemy-single-table -> class transformation?
lang_qc/models/pacbio/well.py
Outdated
of the well. | ||
|
||
The best way to instantiate the object of this class is via the constructor, | ||
giving it the an ORM object representing a database row with information |
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.
Minor grammar confusion.
Yes, to some degree. I expect we will factor out some functionality into stand-alone functions as we convert more classes ot this type of model. |
I am not sure whether the two types of models we use have a common ancestor. If we need this functionality, we should certainly thing about pushing it up to an ancestor or to a stand-alone utility package |
9bf555b
to
4d2efbd
Compare
No description provided.