- json_value = models.TextField(verbose_name='Value (JSON)', help_text='This value must be valid JSON.', validators=[json_validator])
-
- def get_value(self):
- return json.loads(self.json_value)
-
- def set_value(self, value):
- self.json_value = json.dumps(value)
-
- def delete_value(self):
- self.json_value = json.dumps(None)
-
- value = property(get_value, set_value, delete_value)