diff options
| author | Patrick Canfield <patrickcandoit@gmail.com> | 2013-03-18 13:05:41 -0700 |
|---|---|---|
| committer | Pzatrick <patrickcandoit@gmail.com> | 2013-03-21 13:34:15 -0700 |
| commit | b1611cf0d24e2947ebfb58071ff7c695a1d824cc (patch) | |
| tree | 27353fbb1a28ec014fd1e473079259e387625bfc | |
| parent | 203fe8b2a92c18151894f0656b7846cef8ec4e51 (diff) | |
| download | pyramid-b1611cf0d24e2947ebfb58071ff7c695a1d824cc.tar.gz pyramid-b1611cf0d24e2947ebfb58071ff7c695a1d824cc.tar.bz2 pyramid-b1611cf0d24e2947ebfb58071ff7c695a1d824cc.zip | |
Update definingviews.rst explain matchdict more explicitly, concisely
| -rw-r--r-- | docs/tutorials/wiki2/basiclayout.rst | 9 | ||||
| -rw-r--r-- | docs/tutorials/wiki2/definingviews.rst | 15 |
2 files changed, 11 insertions, 13 deletions
diff --git a/docs/tutorials/wiki2/basiclayout.rst b/docs/tutorials/wiki2/basiclayout.rst index 109d368b8..6d6287126 100644 --- a/docs/tutorials/wiki2/basiclayout.rst +++ b/docs/tutorials/wiki2/basiclayout.rst @@ -228,11 +228,10 @@ To give a simple example of a model class, we define one named ``MyModel``: Our example model has an ``__init__`` method that takes two arguments (``name``, and ``value``). It stores these values as ``self.name`` and -``self.value`` -within the ``__init__`` function itself. The ``MyModel`` class also has a -``__tablename__`` attribute. This informs SQLAlchemy which table to use to -store the data representing instances of this class. +``self.value`` within the ``__init__`` function itself. The ``MyModel`` class +also has a ``__tablename__`` attribute. This informs SQLAlchemy which table +to use to store the data representing instances of this class. -That's about all there is to it to models, views, and initialization code in +That's about all there is to it with models, views, and initialization code in our stock application. diff --git a/docs/tutorials/wiki2/definingviews.rst b/docs/tutorials/wiki2/definingviews.rst index f2ac2f85f..72cba8d1e 100644 --- a/docs/tutorials/wiki2/definingviews.rst +++ b/docs/tutorials/wiki2/definingviews.rst @@ -6,14 +6,13 @@ A :term:`view callable` in a :app:`Pyramid` application is typically a simple Python function that accepts a single parameter named :term:`request`. A view callable is assumed to return a :term:`response` object. -The request object passed to every view that is called as the result of a -route match has an attribute named ``matchdict`` that contains the elements -placed into the URL by the ``pattern`` of a ``route`` statement. For -instance, if a call to :meth:`pyramid.config.Configurator.add_route` in -``__init__.py`` had the pattern ``{one}/{two}``, and the URL at -``http://example.com/foo/bar`` was invoked, matching this pattern, the -``matchdict`` dictionary attached to the request passed to the view would -have a ``'one'`` key with the value ``'foo'`` and a ``'two'`` key with the +The request object has an attribute named ``matchdict``. A ``matchdict`` maps +the placeholders in the matching URL ``pattern`` to the substrings of the +:term:`request` ed URL. For instance, if a call to +:meth:`pyramid.config.Configurator.add_route` in ``__init__.py`` had the pattern +``{one}/{two}``, and the URL at ``http://example.com/foo/bar`` was invoked, matching +this pattern, the ``matchdict`` dictionary attached to the request passed to the view +would have a ``'one'`` key with the value ``'foo'`` and a ``'two'`` key with the value ``'bar'``. |
