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

Base Definition for deserialize #18

Open
ztnel opened this issue Apr 24, 2022 · 1 comment
Open

Base Definition for deserialize #18

ztnel opened this issue Apr 24, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ztnel
Copy link
Owner

ztnel commented Apr 24, 2022

Typical definition for deserialize looks like this:

def deserialize(self, **kwargs) -> None:
    for key, value in kwargs:
        setattr(self, key, value)

Its probably safe to add this as a base definition rather than enforcing an override. Overrides will be required for properties that are read only (i.e. no setter definition). Those edge cases should be defined at a model by model basis. But requiring all models to implement this same method is quite tedious.

@ztnel ztnel added the enhancement New feature or request label Apr 24, 2022
@ztnel ztnel added this to To do in Base Library via automation Apr 24, 2022
@ztnel ztnel self-assigned this Apr 24, 2022
@ztnel
Copy link
Owner Author

ztnel commented May 10, 2022

There does need to be a sanity check for read only properties in the base definition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant