- dispatcher.connect(self.post_init, signal=signals.post_init, sender=cls)
-
- def get_json(model_instance):
- return dumps(getattr(model_instance, self.attname, None))
- setattr(cls, 'get_%s_json' % self.name, get_json)
-
- def set_json(model_instance, json):
- return setattr(model_instance, self.attname, loads(json))
- setattr(cls, 'set_%s_json' % self.name, set_json)
+
+ def get_value(model_instance):
+ return loads(getattr(model_instance, self.attname, None))
+ setattr(cls, 'get_%s_value' % self.name, get_value)