summaryrefslogtreecommitdiff
path: root/docs/narr/models.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2008-07-28 05:31:47 +0000
committerChris McDonough <chrism@agendaless.com>2008-07-28 05:31:47 +0000
commit178623bbd8e9aab75b6206ef69f67b62edb3d12e (patch)
tree2442c1d41bdb13a41e4ab841fddcc091d5804ca2 /docs/narr/models.rst
parent96e65d8e6d47a1b806c4d281e6890f77f86407c3 (diff)
downloadpyramid-178623bbd8e9aab75b6206ef69f67b62edb3d12e.tar.gz
pyramid-178623bbd8e9aab75b6206ef69f67b62edb3d12e.tar.bz2
pyramid-178623bbd8e9aab75b6206ef69f67b62edb3d12e.zip
Tweaks.
Diffstat (limited to 'docs/narr/models.rst')
-rw-r--r--docs/narr/models.rst29
1 files changed, 15 insertions, 14 deletions
diff --git a/docs/narr/models.rst b/docs/narr/models.rst
index cff04ea18..1e5685ed6 100644
--- a/docs/narr/models.rst
+++ b/docs/narr/models.rst
@@ -1,9 +1,9 @@
Models
======
-*Models* are typically simple Python classes defined in a module.
- Model *instances* make up the graph that :mod:`repoze.bfg` is willing
- to traverse.
+A :term:`model` is typically a simple Python class defined in a
+module. Model *instances* make up the graph that :mod:`repoze.bfg` is
+willing to traverse.
Defining a Model
----------------
@@ -26,11 +26,11 @@ An example of a model describing a blog entry::
self.created = datetime.datetime.now()
A model consists of two things: the object which defines the model
-(above as the class ``IBlogEntry``), and an *interface* attached to
-the model object. An interface simply tags the model object with a
-"type" that can be referred to within view configuration. A model
-object can implement zero or more interfaces. The interface must be
-an instance of a class that inherits from
+(above as the class ``IBlogEntry``), and an :term:`interface` attached
+to the model object. An interface simply tags the model object with a
+"type" that can be referred to within the :term:`application
+registry`. A model object can implement zero or more interfaces. The
+interface must be an instance of a class that inherits from
``zope.interface.Interface``.
You specify that a model *implements* an interface by using the
@@ -67,13 +67,14 @@ Location-Aware Model Instances
by via ``__getitem__``.
If you choose not to manage the ``__name__`` and ``__parent__``
- attributes of your models "by hand", :mod:`repoze.bfg`` is willing
- to help you do this. If your "root" node claims it implements the
+ attributes of your models "by hand", :mod:`repoze.bfg`` is willing to
+ help you do this. If your "root" node claims it implements the
interface ``zope.location.interfaces.ILocation``, you don't need to
- manage these attributes by hand. During traversal, if the root node
- says it implements ``ILocation``, bfg will wrap each child in a
- LocationProxy which will dynamically assign a ``__name__`` and a
- ``__parent__`` to it, recursively.
+ manage these attributes by hand. During :term:`traversal`, if the
+ root node says it implements the ``ILocation`` :term:`interface`,
+ :mod:`repoze.bfg` will wrap each child in a ``LocationProxy`` which
+ will dynamically assign a ``__name__`` and a ``__parent__`` to it,
+ recursively.
If you choose to make use of the location-based dynamic assignment of
``__parent__`` and ``__name__``, the root node must have a