From c2a2d3930bbf65c1e56315196d4bdc08906312aa Mon Sep 17 00:00:00 2001 From: Casey Duncan Date: Tue, 14 Dec 2010 23:41:30 -0700 Subject: describe container nodes and leaf nodes as such directly --- docs/narr/models.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/narr/models.rst b/docs/narr/models.rst index a1e21d2bb..086c61d45 100644 --- a/docs/narr/models.rst +++ b/docs/narr/models.rst @@ -203,18 +203,18 @@ Defining a Graph of Model Instances for Traversal When :term:`traversal` is used (as opposed to a purely :term:`url dispatch` based application), :app:`Pyramid` expects to be able to traverse a graph composed of model instances. Traversal begins at a -root model, and descends into the graph recursively via each found -model's ``__getitem__`` method. :app:`Pyramid` imposes the +root model instance, and descends into the graph recursively via each +found model's ``__getitem__`` method. :app:`Pyramid` imposes the following policy on model instance nodes in the graph: -- Nodes which contain other nodes (aka "container" nodes) must supply +- Container nodes (i.e., nodes which contain other nodes) must supply a ``__getitem__`` method which is willing to resolve a unicode name to a subobject. If a subobject by that name does not exist in the container, ``__getitem__`` must raise a :exc:`KeyError`. If a subobject by that name *does* exist, the container should return the subobject (another model instance). -- Nodes which do not contain other nodes (aka "leaf" nodes) must not +- Leaf nodes, which do not contain other nodes, must not implement a ``__getitem__``, or if they do, their ``__getitem__`` method must raise a :exc:`KeyError`. -- cgit v1.2.3