I currently have a dict, where:
one_result = {'name':'Acme', 'description': 'Fun time',
'results': {'fun_status': 'Extra', 'fun_title': 'Foo' }
}
I access the values of this dict in many places in my code and also put many of the results in an array and store it in DB:
class Record(models.Model):
results = JSONField(default=[], null=True, blank=True)
I would like to keep things DRY and make a Python object out of the result, so I can access the attributes directly, instead of via key_names: result.name VS result['name']
Is there a way that I can create an object that is backed by a dict(), and easily serialized/deserialized into JSON in my db?