self._cascade_save_or_update(state)
def add(self, instance):
- """Add the given instance into this ``Session``.
+ """Place an object in the ``Session``.
- TODO: rephrase the below in user terms; possibly tie into future
- function that downgrades persistent to transient. [ticket:1052]
+ Its state will be persisted to the database on the next flush
+ operation.
- The non-None state `key` on the instance's state determines whether
- to ``save()`` or ``update()`` the instance.
+ Repeated calls to ``add()`` will be ignored. The opposite of ``add()``
+ is ``expunge()``.
"""
state = _state_for_unknown_persistence_instance(instance)