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
Model consistency, serialisation and methods #149
Comments
When printing models, |
We now have a readable I think we should set the thing up like this:
Enums and timestamps could even be converted back to strings. And now that |
Also, |
I think we should not preserve timestamps and enums when converting the models. They are technically available outside Tekore, but strings are so much more common and straightforward that we'll use them. |
Currently a dataclass behaves like this:
asdict
: strip dataclass but keep other classes, likeTimestamp
and enumsrepr
: Dataclass representation (class name, fields and values recursively)str
: JSON encode all typesWe also have a
ModelList
to allowstr
ing dataclasses. But this is not really comprehensive. It would be nice to include the behavior to all responses, like the tuple of results returned from search. This could be achieved by making all return types share the repr/str structure and using those types as well when parsing inner lists. We could also provide anasdict
equivalent for lists likeaslist
(maybe something else), or call bothasbuiltin
or something like that.The text was updated successfully, but these errors were encountered: