MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / set

Method set

lib/sqlalchemy/orm/events.py:2757–2788  ·  view source on GitHub ↗

Receive a scalar set event. :param target: the object instance receiving the event. If the listener is registered with ``raw=True``, this will be the :class:`.InstanceState` object. :param value: the value being set. If this listener is registered with

(
        self, target: _O, value: _T, oldvalue: _T, initiator: Event
    )

Source from the content-addressed store, hash-verified

2755 """
2756
2757 def set(
2758 self, target: _O, value: _T, oldvalue: _T, initiator: Event
2759 ) -> None:
2760 """Receive a scalar set event.
2761
2762 :param target: the object instance receiving the event.
2763 If the listener is registered with ``raw=True``, this will
2764 be the :class:`.InstanceState` object.
2765 :param value: the value being set. If this listener
2766 is registered with ``retval=True``, the listener
2767 function must return this value, or a new value which
2768 replaces it.
2769 :param oldvalue: the previous value being replaced. This
2770 may also be the symbol ``NEVER_SET`` or ``NO_VALUE``.
2771 If the listener is registered with ``active_history=True``,
2772 the previous value of the attribute will be loaded from
2773 the database if the existing value is currently unloaded
2774 or expired.
2775 :param initiator: An instance of :class:`.attributes.Event`
2776 representing the initiation of the event. May be modified
2777 from its original value by backref handlers in order to control
2778 chained event propagation.
2779
2780 :return: if the event was registered with ``retval=True``,
2781 the given value, or a new effective value, should be returned.
2782
2783 .. seealso::
2784
2785 :class:`.AttributeEvents` - background on listener options such
2786 as propagation to subclasses.
2787
2788 """
2789
2790 def init_scalar(
2791 self, target: _O, value: _T, dict_: Dict[Any, Any]

Callers 12

mergeMethod · 0.45
mergeMethod · 0.45
_setup_entity_queryFunction · 0.45
_instance_processorFunction · 0.45
_populateFunction · 0.45
__call__Method · 0.45
create_row_processorMethod · 0.45
_generate_row_adapterMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected