0008-environment-add-a-setter-for-Variable.json-29240.patch
hobo/environment/models.py | ||
---|---|---|
72 | 72 |
raise ValidationError('invalid JSON document') |
73 | 73 |
return self.value |
74 | 74 | |
75 |
@property |
|
76 |
def json(self): |
|
75 |
def json_getter(self): |
|
77 | 76 |
try: |
78 | 77 |
return self._parse_value_as_json() |
79 | 78 |
except ValidationError: |
80 | 79 |
return self.value |
81 | 80 | |
81 |
def json_setter(self, value): |
|
82 |
self.value = json.dumps(value) |
|
83 | ||
84 |
json = property(json_getter, json_setter) |
|
85 | ||
82 | 86 |
def clean(self): |
83 | 87 |
self._parse_value_as_json() |
84 | 88 | |
85 |
- |