MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / fdel

Method fdel

lib/sqlalchemy/ext/indexable.py:344–355  ·  view source on GitHub ↗
(self, instance: Any)

Source from the content-addressed store, hash-verified

342 flag_modified(instance, attr_name)
343
344 def fdel(self, instance: Any) -> None:
345 attr_name = self.attr_name
346 column_value = getattr(instance, attr_name)
347 if column_value is None:
348 raise AttributeError(self.attr_name)
349 try:
350 del column_value[self.index]
351 except KeyError as err:
352 raise AttributeError(self.attr_name) from err
353 else:
354 setattr(instance, attr_name, column_value)
355 flag_modified(instance, attr_name)
356
357 def expr(
358 self, model: Any

Callers 1

__delete__Method · 0.45

Calls 1

flag_modifiedFunction · 0.85

Tested by

no test coverage detected