use get_prep_value / to_python before serializing changed values
This commit is contained in:
parent
410398b21e
commit
1d9564568b
2 changed files with 2 additions and 2 deletions
|
@ -117,7 +117,7 @@ class ChangeSet(models.Model):
|
||||||
setattr(obj, class_value.cache_name, self.get_created_object(class_value.field.model, pk))
|
setattr(obj, class_value.cache_name, self.get_created_object(class_value.field.model, pk))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
setattr(obj, name, value)
|
setattr(obj, name, model._meta.get_field(name).to_python(value))
|
||||||
return self.wrap(obj, author=author)
|
return self.wrap(obj, author=author)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -198,7 +198,7 @@ class ModelInstanceWrapper(BaseWrapper):
|
||||||
self._changeset.add_update(self, name='title_'+lang, value=new_title, author=author)
|
self._changeset.add_update(self, name='title_'+lang, value=new_title, author=author)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
self._changeset.add_update(self, name=field.name, value=new_value, author=author)
|
self._changeset.add_update(self, name=field.name, value=field.get_prep_value(new_value), author=author)
|
||||||
|
|
||||||
def delete(self, author=None):
|
def delete(self, author=None):
|
||||||
if author is None:
|
if author is None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue