Handling models with lists inside a json #475
Answered
by
igormorgado
igormorgado
asked this question in
Q&A
-
A remote API returns a JSON object that contains a list of objects something like:
My ormar model is something like class MyModel(orm.Model):
id: int = orm.Integer(primary_key=True),
name: str = orm.String(max_length=32),
other: List[Any] = WHAT TO PUT HERE TO HANDLE THAT BEAST?
class Metadata(BaseMeta):
tablename='my_models' My question is how to handle that weird
|
Beta Was this translation helpful? Give feedback.
Answered by
igormorgado
Dec 7, 2021
Replies: 1 comment
-
Just to answer myself.. A list is still valid json hence:
That works. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
collerek
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just to answer myself.. A list is still valid json hence:
That works.