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