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

Method __get__

mongoengine/fields.py:1847–1860  ·  view source on GitHub ↗
(self, instance, owner)

Source from the content-addressed store, hash-verified

1845 self.db_alias = db_alias
1846
1847 def __get__(self, instance, owner):
1848 if instance is None:
1849 return self
1850
1851 # Check if a file already exists for this model
1852 grid_file = instance._data.get(self.name)
1853 if not isinstance(grid_file, self.proxy_class):
1854 grid_file = self.get_proxy_obj(key=self.name, instance=instance)
1855 instance._data[self.name] = grid_file
1856
1857 if not grid_file.key:
1858 grid_file.key = self.name
1859 grid_file.instance = instance
1860 return grid_file
1861
1862 def __set__(self, instance, value):
1863 key = self.name

Callers

nothing calls this directly

Calls 2

get_proxy_objMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected