MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / fset

Method fset

lib/sqlalchemy/ext/indexable.py:333–342  ·  view source on GitHub ↗
(self, instance: Any, value: _T)

Source from the content-addressed store, hash-verified

331 return value # type: ignore[no-any-return]
332
333 def fset(self, instance: Any, value: _T) -> None:
334 attr_name = self.attr_name
335 column_value = getattr(instance, attr_name, None)
336 if column_value is None:
337 column_value = self.datatype()
338 setattr(instance, attr_name, column_value)
339 column_value[self.index] = value
340 setattr(instance, attr_name, column_value)
341 if attr_name in inspect(instance).mapper.attrs:
342 flag_modified(instance, attr_name)
343
344 def fdel(self, instance: Any) -> None:
345 attr_name = self.attr_name

Callers 1

__set__Method · 0.45

Calls 2

inspectFunction · 0.90
flag_modifiedFunction · 0.85

Tested by

no test coverage detected