Moved private method to make class more readable
This commit is contained in:
parent
b039a2293f
commit
4036e9fe34
1 changed files with 5 additions and 5 deletions
|
|
@ -775,11 +775,6 @@ class GridFSProxy(object):
|
||||||
self.gridout = None
|
self.gridout = None
|
||||||
self._mark_as_changed()
|
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):
|
def replace(self, file_obj, **kwargs):
|
||||||
self.delete()
|
self.delete()
|
||||||
self.put(file_obj, **kwargs)
|
self.put(file_obj, **kwargs)
|
||||||
|
|
@ -788,6 +783,11 @@ class GridFSProxy(object):
|
||||||
if self.newfile:
|
if self.newfile:
|
||||||
self.newfile.close()
|
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):
|
class FileField(BaseField):
|
||||||
"""A GridFS storage field.
|
"""A GridFS storage field.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue