I have some python library with Record class.
Record class accepts data using only kwargs
.
I populate Records like this and it works ok:
class Animal(Record):
name = String(required=True)
animal = Animal(**{'name': 'joe'})
The library also supports nesting Records like this:
class Fur(Record):
color = String(required=True)
class Animal(Record):
fur = Fur(required=True)
However when I try to populate with:
animal = Animal(**{'fur': {'color': 'red'}})
it fails because the subrecord do not receive color=red
but receives {'color': 'red'}
instead.
So I would need a kind of "recursive **" ?