def get_value(model_instance):
return loads(getattr(model_instance, self.attname, None))
setattr(cls, 'get_%s_value' % self.name, get_value)
def get_value(model_instance):
return loads(getattr(model_instance, self.attname, None))
setattr(cls, 'get_%s_value' % self.name, get_value)