MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / put

Method put

mongoengine/fields.py:1778–1785  ·  view source on GitHub ↗
(self, file_obj, **kwargs)

Source from the content-addressed store, hash-verified

1776 self._mark_as_changed()
1777
1778 def put(self, file_obj, **kwargs):
1779 if self.grid_id:
1780 raise GridFSError(
1781 "This document already has a file. Either delete "
1782 "it or call replace to overwrite it"
1783 )
1784 self.grid_id = self.fs.put(file_obj, **kwargs)
1785 self._mark_as_changed()
1786
1787 def write(self, string):
1788 if self.grid_id:

Callers 15

replaceMethod · 0.95
__set__Method · 0.45
putMethod · 0.45
_put_thumbnailMethod · 0.45
test_file_fieldsMethod · 0.45
test_file_uniquenessMethod · 0.45
test_file_savingMethod · 0.45
test_file_booleanMethod · 0.45
test_file_disk_spaceMethod · 0.45
test_image_fieldMethod · 0.45

Calls 2

_mark_as_changedMethod · 0.95
GridFSErrorClass · 0.85

Tested by 13

test_file_fieldsMethod · 0.36
test_file_uniquenessMethod · 0.36
test_file_savingMethod · 0.36
test_file_booleanMethod · 0.36
test_file_disk_spaceMethod · 0.36
test_image_fieldMethod · 0.36
test_file_multidbMethod · 0.36
test_copyableMethod · 0.36