It would be nice to be able to ignore the key metadata field when serializing or deserializing. An example would be:
class C:
a_name = StringField(key='name')
json = {'name': 'Rodrigo'}
c = to_model(C, json)
d = to_dict(c, ignore_keys=True)
"""
d is {'a_name': 'Rodrigo'}
"""
It would also work
json = {'a_name': 'Rodrigo'}
c = to_model(C, json, ignore_keys=True)
I'll create a PR with my solution to this. I hope you find it useful as well and accept it :).
It would be nice to be able to ignore the
key
metadata field when serializing or deserializing. An example would be:It would also work
I'll create a PR with my solution to this. I hope you find it useful as well and accept it :).