summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-09-10 10:00:46 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-09-10 10:00:46 -0400
commit03797b78475bec9fb9c15f8e926414f3720a273c (patch)
treee5aa7d9ce00e4184a48f46ccf27e974fa4ae1453 /lib/sqlalchemy
parentdb824b535359abef145303556a227ccda3cdcccc (diff)
downloadsqlalchemy-03797b78475bec9fb9c15f8e926414f3720a273c.tar.gz
- add a new FAQ recipe for "walk all objects", replacing the need
to use mapper.cascade_iterator() for this purpose as it was not really designed for that use case. Add docs to cascade_iterator() pointing to the recipe. fixes #3498
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/mapper.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index 1a46667c5..21577f5ea 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -2571,15 +2571,24 @@ class Mapper(InspectionAttr):
for all relationships that meet the given cascade rule.
:param type_:
- The name of the cascade rule (i.e. save-update, delete,
- etc.)
+ The name of the cascade rule (i.e. ``"save-update"``, ``"delete"``,
+ etc.).
+
+ .. note:: the ``"all"`` cascade is not accepted here. For a generic
+ object traversal function, see :ref:`faq_walk_objects`.
:param state:
The lead InstanceState. child items will be processed per
the relationships defined for this object's mapper.
- the return value are object instances; this provides a strong
- reference so that they don't fall out of scope immediately.
+ :return: the method yields individual object instances.
+
+ .. seealso::
+
+ :ref:`unitofwork_cascades`
+
+ :ref:`faq_walk_objects` - illustrates a generic function to
+ traverse all objects without relying on cascades.
"""
visited_states = set()