diff --git a/mongoengine/fields.py b/mongoengine/fields.py index 50a30a13..bac312bd 100644 --- a/mongoengine/fields.py +++ b/mongoengine/fields.py @@ -775,11 +775,6 @@ class GridFSProxy(object): self.gridout = None self._mark_as_changed() - def _mark_as_changed(self): - """Inform the instance that `self.key` has been changed""" - if self.instance: - self.instance._mark_as_changed(self.key) - def replace(self, file_obj, **kwargs): self.delete() self.put(file_obj, **kwargs) @@ -788,6 +783,11 @@ class GridFSProxy(object): if self.newfile: self.newfile.close() + def _mark_as_changed(self): + """Inform the instance that `self.key` has been changed""" + if self.instance: + self.instance._mark_as_changed(self.key) + class FileField(BaseField): """A GridFS storage field.