diff options
| author | Chris McDonough <chrism@plope.com> | 2012-03-17 10:39:17 -0700 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2012-03-17 10:39:17 -0700 |
| commit | fca8f01565d99d841bed0dfb3c784042af693ab1 (patch) | |
| tree | 76b5db7cca027e9bcc1dc81be111b8bfae90a2b6 /docs/tutorials/wiki2/basiclayout.rst | |
| parent | 2c6f63a15ba4dff7aaddfa09a7066590c1a833ce (diff) | |
| parent | ef501bb1618e12ec9f0a57ba5cf873616f7c440a (diff) | |
| download | pyramid-fca8f01565d99d841bed0dfb3c784042af693ab1.tar.gz pyramid-fca8f01565d99d841bed0dfb3c784042af693ab1.tar.bz2 pyramid-fca8f01565d99d841bed0dfb3c784042af693ab1.zip | |
Merge pull request #496 from douglatornell/sql-tut-edits
Improve text of SQLAlchemy wiki tutorial.
Diffstat (limited to 'docs/tutorials/wiki2/basiclayout.rst')
| -rw-r--r-- | docs/tutorials/wiki2/basiclayout.rst | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/tutorials/wiki2/basiclayout.rst b/docs/tutorials/wiki2/basiclayout.rst index 39321a88e..6715b2bd7 100644 --- a/docs/tutorials/wiki2/basiclayout.rst +++ b/docs/tutorials/wiki2/basiclayout.rst @@ -74,7 +74,7 @@ dictionary of settings parsed from the ``.ini`` file, which contains deployment-related values such as ``pyramid.reload_templates``, ``db_string``, etc. -``'main`` now calls :meth:`pyramid.config.Configurator.add_static_view` with +``main`` now calls :meth:`pyramid.config.Configurator.add_static_view` with two arguments: ``static`` (the name), and ``static`` (the path): .. literalinclude:: src/basiclayout/tutorial/__init__.py @@ -123,10 +123,11 @@ Finally, ``main`` is finished configuring things, so it uses the View Declarations via ``views.py`` ---------------------------------- -Mapping a :term:`route` to code that will be executed when that route's -pattern matches is done by registering a :term:`view configuration`. Our -application uses the :meth:`pyramid.view.view_config` decorator to map view -callables to each route, thereby mapping URL patterns to code. +Mapping a :term:`route` to code that will be executed when a match for +the route's pattern occurs is done by registering a :term:`view +configuration`. Our application uses the +:meth:`pyramid.view.view_config` decorator to map view callables to +each route, thereby mapping URL patterns to code. Open ``tutorial/tutorial/views.py``. It should already contain the following: @@ -151,7 +152,7 @@ Note that ``my_view()`` accepts a single argument named ``request``. This is the standard call signature for a Pyramid :term:`view callable`. Remember in our ``__init__.py`` when we executed the -:meth:`pyramid.config.Configurator.scan` method, e.g. ``config.scan()``? The +:meth:`pyramid.config.Configurator.scan` method, i.e. ``config.scan()``? The purpose of calling the scan method was to find and process this ``@view_config`` decorator in order to create a view configuration within our application. Without being processed by ``scan``, the decorator effectively @@ -199,7 +200,7 @@ To give a simple example of a model class, we define one named ``MyModel``: :linenos: :language: py -Our sample model has an ``__init__`` that takes a two arguments (``name``, +Our example model has an ``__init__`` that takes a 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 |
