Closed ezrakahn closed 7 months ago
Reading the class definition it seems to be behaving as written, but I do not understand the purpose of this method. Thanks in advance for your help!
Right, it would be good if from_json
would return the instance on which it was called. (For the next version, it would be even better when from_json
would be a static method so that the example would look like this: olca_cat = olca.Category.from_json(json_dict)
). However, currently the usage is like this:
# create an instance
olca_cat = olca.Category()
# fill the instance with data from a dictionary
olca_cat.from_json(json_dict)
# then you can use it
print(olca_cat.name)
Got it, Thanks!
First of all, really enjoying this package, thank you!
I am not sure I understand how to use the from_json method. I would expect it would return an olca.schema object but it doesn't seem to return anything. Am I missing something? Below is an example of what I am trying to do.