summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2015-05-24 19:15:22 -0700
committerSteve Piercy <web@stevepiercy.com>2015-05-24 19:15:22 -0700
commitee9676a8691dd18b88d3247fd8c1306c5aaa1543 (patch)
tree0e323848c78996bb624a6caec7215a3102c94d7b
parentec753b060040a2a6df91341d6d4ed0913761adbc (diff)
downloadpyramid-ee9676a8691dd18b88d3247fd8c1306c5aaa1543.tar.gz
pyramid-ee9676a8691dd18b88d3247fd8c1306c5aaa1543.tar.bz2
pyramid-ee9676a8691dd18b88d3247fd8c1306c5aaa1543.zip
- make templates html5 compliant
- punctuation, grammar, spelling - fix linenos references - update outputs
-rw-r--r--docs/tutorials/wiki2/basiclayout.rst10
-rw-r--r--docs/tutorials/wiki2/definingmodels.rst61
-rw-r--r--docs/tutorials/wiki2/definingviews.rst46
-rw-r--r--docs/tutorials/wiki2/design.rst4
-rw-r--r--docs/tutorials/wiki2/installation.rst85
-rw-r--r--docs/tutorials/wiki2/src/views/tutorial/templates/edit.pt28
-rw-r--r--docs/tutorials/wiki2/src/views/tutorial/templates/view.pt24
-rw-r--r--docs/tutorials/wiki2/src/views/tutorial/views.py1
8 files changed, 129 insertions, 130 deletions
diff --git a/docs/tutorials/wiki2/basiclayout.rst b/docs/tutorials/wiki2/basiclayout.rst
index 05781c044..90157aa9e 100644
--- a/docs/tutorials/wiki2/basiclayout.rst
+++ b/docs/tutorials/wiki2/basiclayout.rst
@@ -4,7 +4,7 @@ Basic Layout
The starter files generated by the ``alchemy`` scaffold are very basic, but
they provide a good orientation for the high-level patterns common to most
-:term:`url dispatch` -based :app:`Pyramid` projects.
+:term:`URL dispatch`-based :app:`Pyramid` projects.
Application Configuration with ``__init__.py``
@@ -12,7 +12,7 @@ Application Configuration with ``__init__.py``
A directory on disk can be turned into a Python :term:`package` by containing
an ``__init__.py`` file. Even if empty, this marks a directory as a Python
-package. We use ``__init__.py`` both as a marker indicating the directory
+package. We use ``__init__.py``, both as a marker indicating the directory
it's contained within is a package, and to contain configuration code.
Open ``tutorial/tutorial/__init__.py``. It should already contain
@@ -114,7 +114,7 @@ used when the URL is ``/``:
:lines: 19
:language: py
-Since this route has a ``pattern`` equalling ``/`` it is the route that will
+Since this route has a ``pattern`` equaling ``/`` it is the route that will
be matched when the URL ``/`` is visited, e.g. ``http://localhost:6543/``.
``main`` next calls the ``scan`` method of the configurator
@@ -167,7 +167,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, i.e. ``config.scan()``? The
+:meth:`pyramid.config.Configurator.scan` method ``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
@@ -175,7 +175,7 @@ does nothing. ``@view_config`` is inert without being detected via a
:term:`scan`.
The sample ``my_view()`` created by the scaffold uses a ``try:`` and ``except:``
-clause, to detect if there is a problem accessing the project database and
+clause to detect if there is a problem accessing the project database and
provide an alternate error response. That response will include the text
shown at the end of the file, which will be displayed in the browser to
inform the user about possible actions to take to solve the problem.
diff --git a/docs/tutorials/wiki2/definingmodels.rst b/docs/tutorials/wiki2/definingmodels.rst
index e30af12b2..3ce3a7992 100644
--- a/docs/tutorials/wiki2/definingmodels.rst
+++ b/docs/tutorials/wiki2/definingmodels.rst
@@ -24,9 +24,10 @@ following:
.. literalinclude:: src/models/tutorial/models.py
:linenos:
:language: py
- :emphasize-lines: 20-22,25
+ :emphasize-lines: 20-22,24,25
-(The highlighted lines are the ones that need to be changed.)
+The highlighted lines are the ones that need to be changed, as well as
+removing lines that reference ``Index``.
The first thing we've done is remove the stock ``MyModel`` class
from the generated ``models.py`` file. The ``MyModel`` class is only a
@@ -57,8 +58,8 @@ Changing ``scripts/initializedb.py``
We haven't looked at the details of this file yet, but within the ``scripts``
directory of your ``tutorial`` package is a file named ``initializedb.py``. Code
-in this file is executed whenever we run the ``initialize_tutorial_db`` command
-(as we did in the installation step of this tutorial).
+in this file is executed whenever we run the ``initialize_tutorial_db`` command,
+as we did in the installation step of this tutorial.
Since we've changed our model, we need to make changes to our ``initializedb.py``
script. In particular, we'll replace our import of ``MyModel`` with one of
@@ -71,9 +72,11 @@ following:
.. literalinclude:: src/models/tutorial/scripts/initializedb.py
:linenos:
:language: python
- :emphasize-lines: 14,36
+ :emphasize-lines: 14,31,36
-(Only the highlighted lines need to be changed.)
+Only the highlighted lines need to be changed, as well as removing the lines
+referencing ``pyramid.scripts.common`` and ``options`` under the ``main``
+function.
Installing the Project and re-initializing the Database
-------------------------------------------------------
@@ -85,30 +88,28 @@ See :ref:`initialize_db_wiki2` for instructions.
Success will look something like this::
- 2011-11-27 01:22:45,277 INFO [sqlalchemy.engine.base.Engine][MainThread]
- PRAGMA table_info("pages")
- 2011-11-27 01:22:45,277 INFO [sqlalchemy.engine.base.Engine][MainThread] ()
- 2011-11-27 01:22:45,277 INFO [sqlalchemy.engine.base.Engine][MainThread]
- CREATE TABLE pages (
- id INTEGER NOT NULL,
- name TEXT,
- data TEXT,
- PRIMARY KEY (id),
- UNIQUE (name)
- )
-
-
- 2011-11-27 01:22:45,278 INFO [sqlalchemy.engine.base.Engine][MainThread] ()
- 2011-11-27 01:22:45,397 INFO [sqlalchemy.engine.base.Engine][MainThread]
- COMMIT
- 2011-11-27 01:22:45,400 INFO [sqlalchemy.engine.base.Engine][MainThread]
- BEGIN (implicit)
- 2011-11-27 01:22:45,401 INFO [sqlalchemy.engine.base.Engine][MainThread]
- INSERT INTO pages (name, data) VALUES (?, ?)
- 2011-11-27 01:22:45,401 INFO [sqlalchemy.engine.base.Engine][MainThread]
- ('FrontPage', 'This is the front page')
- 2011-11-27 01:22:45,402 INFO [sqlalchemy.engine.base.Engine][MainThread]
- COMMIT
+ 2015-05-24 15:34:14,542 INFO [sqlalchemy.engine.base.Engine:1192][MainThread] SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1
+ 2015-05-24 15:34:14,542 INFO [sqlalchemy.engine.base.Engine:1193][MainThread] ()
+ 2015-05-24 15:34:14,543 INFO [sqlalchemy.engine.base.Engine:1192][MainThread] SELECT CAST('test unicode returns' AS VARCHAR(60)) AS anon_1
+ 2015-05-24 15:34:14,543 INFO [sqlalchemy.engine.base.Engine:1193][MainThread] ()
+ 2015-05-24 15:34:14,543 INFO [sqlalchemy.engine.base.Engine:1097][MainThread] PRAGMA table_info("pages")
+ 2015-05-24 15:34:14,544 INFO [sqlalchemy.engine.base.Engine:1100][MainThread] ()
+ 2015-05-24 15:34:14,544 INFO [sqlalchemy.engine.base.Engine:1097][MainThread]
+ CREATE TABLE pages (
+ id INTEGER NOT NULL,
+ name TEXT,
+ data INTEGER,
+ PRIMARY KEY (id),
+ UNIQUE (name)
+ )
+
+
+ 2015-05-24 15:34:14,545 INFO [sqlalchemy.engine.base.Engine:1100][MainThread] ()
+ 2015-05-24 15:34:14,546 INFO [sqlalchemy.engine.base.Engine:686][MainThread] COMMIT
+ 2015-05-24 15:34:14,548 INFO [sqlalchemy.engine.base.Engine:646][MainThread] BEGIN (implicit)
+ 2015-05-24 15:34:14,549 INFO [sqlalchemy.engine.base.Engine:1097][MainThread] INSERT INTO pages (name, data) VALUES (?, ?)
+ 2015-05-24 15:34:14,549 INFO [sqlalchemy.engine.base.Engine:1100][MainThread] ('FrontPage', 'This is the front page')
+ 2015-05-24 15:34:14,550 INFO [sqlalchemy.engine.base.Engine:686][MainThread] COMMIT
Viewing the Application in a Browser
------------------------------------
diff --git a/docs/tutorials/wiki2/definingviews.rst b/docs/tutorials/wiki2/definingviews.rst
index 49dbed50f..dd1cb491d 100644
--- a/docs/tutorials/wiki2/definingviews.rst
+++ b/docs/tutorials/wiki2/definingviews.rst
@@ -11,8 +11,8 @@ The request object has a dictionary as an attribute named ``matchdict``. A
substrings of the path in the :term:`request` URL. For instance, if a call to
:meth:`pyramid.config.Configurator.add_route` has the pattern ``/{one}/{two}``,
and a user visits ``http://example.com/foo/bar``, our pattern would be matched
-against ``/foo/bar`` and the ``matchdict`` would look like: ``{'one':'foo',
-'two':'bar'}``
+against ``/foo/bar`` and the ``matchdict`` would look like ``{'one':'foo',
+'two':'bar'}``.
Declaring Dependencies in Our ``setup.py`` File
===============================================
@@ -32,7 +32,7 @@ Open ``tutorial/setup.py`` and edit it to look like the following:
:language: python
:emphasize-lines: 20
-(Only the highlighted line needs to be added.)
+Only the highlighted line needs to be added.
Running ``setup.py develop``
============================
@@ -71,9 +71,9 @@ It's time for a major change. Open ``tutorial/tutorial/views.py`` and edit it t
.. literalinclude:: src/views/tutorial/views.py
:linenos:
:language: python
- :emphasize-lines: 1-7,12,15-70
+ :emphasize-lines: 1-7,14,16-72
-(The highlighted lines are the ones that need to be added or edited.)
+The highlighted lines are the ones that need to be added or edited.
We got rid of the ``my_view`` view function and its decorator that was
added when we originally rendered the ``alchemy`` scaffold. It was only an
@@ -93,7 +93,7 @@ afterward.
.. note::
There is nothing special about the filename ``views.py``. A project may
- have many view callables throughout its codebase in arbitrarily-named
+ have many view callables throughout its codebase in arbitrarily named
files. Files implementing view callables often have ``view`` in their
filenames (or may live in a Python subpackage of your application package
named ``views``), but this is only by convention.
@@ -106,7 +106,7 @@ is made to the root URL of our wiki. It always redirects to
a URL which represents the path to our "FrontPage".
.. literalinclude:: src/views/tutorial/views.py
- :lines: 18-21
+ :lines: 20-23
:linenos:
:language: python
@@ -116,8 +116,8 @@ the :class:`pyramid.interfaces.IResponse` interface like
:class:`pyramid.response.Response` does).
It uses the :meth:`pyramid.request.Request.route_url` API to construct a
-URL to the ``FrontPage`` page (e.g. ``http://localhost:6543/FrontPage``), which
-is used as the "location" of the ``HTTPFound`` response, forming an HTTP redirect.
+URL to the ``FrontPage`` page (e.g., ``http://localhost:6543/FrontPage``), which
+is used as the location of the ``HTTPFound`` response, forming an HTTP redirect.
The ``view_page`` view function
-------------------------------
@@ -165,25 +165,25 @@ request passed to the ``add_page()`` view will have the values we need
to construct URLs and find model objects.
.. literalinclude:: src/views/tutorial/views.py
- :lines: 45-56
+ :lines: 47-58
:linenos:
:language: python
The ``matchdict`` will have a ``'pagename'`` key that matches the name of
the page we'd like to add. If our add view is invoked via,
-e.g. ``http://localhost:6543/add_page/SomeName``, the value for
+e.g., ``http://localhost:6543/add_page/SomeName``, the value for
``'pagename'`` in the ``matchdict`` will be ``'SomeName'``.
-If the view execution *is* a result of a form submission (i.e. the expression
-``'form.submitted' in request.params`` is ``True``), we scrape the page body
+If the view execution *is* a result of a form submission (i.e., the expression
+``'form.submitted' in request.params`` is ``True``), we grab the page body
from the form data, create a Page object with this page body and the name
taken from ``matchdict['pagename']``, and save it into the database using
``DBSession.add``. We then redirect back to the ``view_page`` view for the
newly created page.
-If the view execution is *not* a result of a form submission (i.e. the
+If the view execution is *not* a result of a form submission (i.e., the
expression ``'form.submitted' in request.params`` is ``False``), the view
-callable renders a template. To do so, it generates a "save url" which the
+callable renders a template. To do so, it generates a ``save_url`` which the
template uses as the form post URL during rendering. We're lazy here, so
we're going to use the same template (``templates/edit.pt``) for the add
view as well as the page edit view. To do so we create a dummy Page object
@@ -201,17 +201,17 @@ request passed to the ``edit_page`` view will have a ``'pagename'`` key
matching the name of the page the user wants to edit.
.. literalinclude:: src/views/tutorial/views.py
- :lines: 58-70
+ :lines: 60-72
:linenos:
:language: python
-If the view execution *is* a result of a form submission (i.e. the expression
+If the view execution *is* a result of a form submission (i.e., the expression
``'form.submitted' in request.params`` is ``True``), the view grabs the
``body`` element of the request parameters and sets it as the ``data``
attribute of the page object. It then redirects to the ``view_page`` view
of the wiki page.
-If the view execution is *not* a result of a form submission (i.e. the
+If the view execution is *not* a result of a form submission (i.e., the
expression ``'form.submitted' in request.params`` is ``False``), the view
simply renders the edit form, passing the page object and a ``save_url``
which will be used as the action of the generated form.
@@ -239,12 +239,12 @@ This template is used by ``view_page()`` for displaying a single
wiki page. It includes:
- A ``div`` element that is replaced with the ``content``
- value provided by the view (rows 45-47). ``content``
+ value provided by the view (lines 43-45). ``content``
contains HTML, so the ``structure`` keyword is used
- to prevent escaping it (i.e. changing ">" to "&gt;", etc.)
+ to prevent escaping it (i.e., changing ">" to "&gt;", etc.)
- A link that points
at the "edit" URL which invokes the ``edit_page`` view for
- the page being viewed (rows 49-51).
+ the page being viewed (lines 47-49).
The ``edit.pt`` Template
------------------------
@@ -254,7 +254,7 @@ content:
.. literalinclude:: src/views/tutorial/templates/edit.pt
:linenos:
- :language: xml
+ :language: html
This template is used by ``add_page()`` and ``edit_page()`` for adding
and editing a wiki page. It displays
@@ -265,7 +265,7 @@ a page containing a form that includes:
- A submit button that has the name ``form.submitted`` (row 48).
The form POSTs back to the "save_url" argument supplied
-by the view (row 45). The view will use the ``body`` and
+by the view (row 43). The view will use the ``body`` and
``form.submitted`` values.
.. note:: Our templates use a ``request`` object that
diff --git a/docs/tutorials/wiki2/design.rst b/docs/tutorials/wiki2/design.rst
index ff7413668..fa291cdc0 100644
--- a/docs/tutorials/wiki2/design.rst
+++ b/docs/tutorials/wiki2/design.rst
@@ -124,7 +124,7 @@ listed in the following table:
| | authenticate. | | | |
| | | | | |
| | - If authentication | | | |
-| | successful, | | | |
+| | succeeds, | | | |
| | redirect to the | | | |
| | page that we | | | |
| | came from. | | | |
@@ -144,6 +144,6 @@ listed in the following table:
when there is no view name.
.. [2] Pyramid will return a default 404 Not Found page
if the page *PageName* does not exist yet.
-.. [3] pyramid.exceptions.Forbidden is reached when a
+.. [3] ``pyramid.exceptions.Forbidden`` is reached when a
user tries to invoke a view that is
not authorized by the authorization policy.
diff --git a/docs/tutorials/wiki2/installation.rst b/docs/tutorials/wiki2/installation.rst
index e21bf7108..9b0389feb 100644
--- a/docs/tutorials/wiki2/installation.rst
+++ b/docs/tutorials/wiki2/installation.rst
@@ -120,7 +120,7 @@ projects. We will use `pcreate`—a script that comes with Pyramid to
quickly and easily generate scaffolds usually with a single command—to
create the scaffold for our project.
-By passing in `alchemy` into the `pcreate` command, the script creates
+By passing `alchemy` into the `pcreate` command, the script creates
the files needed to use SQLAlchemy. By passing in our application name
`tutorial`, the script inserts that application name into all the
required files. For example, `pcreate` creates the
@@ -258,20 +258,19 @@ On Windows
If successful, you will see output something like this::
- .
- Name Stmts Miss Cover Missing
- ------------------------------------------------
- tutorial 11 7 36% 9-15
- tutorial.models 17 0 100%
- tutorial.scripts 0 0 100%
- tutorial.tests 24 0 100%
- tutorial.views 6 0 100%
- ------------------------------------------------
- TOTAL 58 7 88%
- ----------------------------------------------------------------------
- Ran 1 test in 0.459s
+ .
+ Name Stmts Miss Cover Missing
+ ---------------------------------------------------
+ tutorial.py 13 9 31% 13-21
+ tutorial/models.py 12 0 100%
+ tutorial/scripts.py 0 0 100%
+ tutorial/views.py 11 0 100%
+ ---------------------------------------------------
+ TOTAL 36 9 75%
+ ----------------------------------------------------------------------
+ Ran 2 tests in 0.643s
- OK
+ OK
Looks like our package doesn't quite have 100% test coverage.
@@ -284,7 +283,7 @@ Initializing the Database
We need to use the ``initialize_tutorial_db`` :term:`console
script` to initialize our database.
-Type the following command, make sure you are still in the ``tutorial``
+Type the following command, making sure you are still in the ``tutorial``
directory (the directory with a ``development.ini`` in it):
On UNIX
@@ -303,28 +302,30 @@ On Windows
The output to your console should be something like this::
- 2011-11-26 14:42:25,012 INFO [sqlalchemy.engine.base.Engine][MainThread]
- PRAGMA table_info("models")
- 2011-11-26 14:42:25,013 INFO [sqlalchemy.engine.base.Engine][MainThread] ()
- 2011-11-26 14:42:25,013 INFO [sqlalchemy.engine.base.Engine][MainThread]
- CREATE TABLE models (
- id INTEGER NOT NULL,
- name VARCHAR(255),
- value INTEGER,
- PRIMARY KEY (id),
- UNIQUE (name)
- )
- 2011-11-26 14:42:25,013 INFO [sqlalchemy.engine.base.Engine][MainThread] ()
- 2011-11-26 14:42:25,135 INFO [sqlalchemy.engine.base.Engine][MainThread]
- COMMIT
- 2011-11-26 14:42:25,137 INFO [sqlalchemy.engine.base.Engine][MainThread]
- BEGIN (implicit)
- 2011-11-26 14:42:25,138 INFO [sqlalchemy.engine.base.Engine][MainThread]
- INSERT INTO models (name, value) VALUES (?, ?)
- 2011-11-26 14:42:25,139 INFO [sqlalchemy.engine.base.Engine][MainThread]
- (u'one', 1)
- 2011-11-26 14:42:25,140 INFO [sqlalchemy.engine.base.Engine][MainThread]
- COMMIT
+ 2015-05-23 16:49:49,609 INFO [sqlalchemy.engine.base.Engine:1192][MainThread] SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1
+ 2015-05-23 16:49:49,609 INFO [sqlalchemy.engine.base.Engine:1193][MainThread] ()
+ 2015-05-23 16:49:49,610 INFO [sqlalchemy.engine.base.Engine:1192][MainThread] SELECT CAST('test unicode returns' AS VARCHAR(60)) AS anon_1
+ 2015-05-23 16:49:49,610 INFO [sqlalchemy.engine.base.Engine:1193][MainThread] ()
+ 2015-05-23 16:49:49,610 INFO [sqlalchemy.engine.base.Engine:1097][MainThread] PRAGMA table_info("models")
+ 2015-05-23 16:49:49,610 INFO [sqlalchemy.engine.base.Engine:1100][MainThread] ()
+ 2015-05-23 16:49:49,612 INFO [sqlalchemy.engine.base.Engine:1097][MainThread]
+ CREATE TABLE models (
+ id INTEGER NOT NULL,
+ name TEXT,
+ value INTEGER,
+ PRIMARY KEY (id)
+ )
+
+
+ 2015-05-23 16:49:49,612 INFO [sqlalchemy.engine.base.Engine:1100][MainThread] ()
+ 2015-05-23 16:49:49,613 INFO [sqlalchemy.engine.base.Engine:686][MainThread] COMMIT
+ 2015-05-23 16:49:49,613 INFO [sqlalchemy.engine.base.Engine:1097][MainThread] CREATE UNIQUE INDEX my_index ON models (name)
+ 2015-05-23 16:49:49,613 INFO [sqlalchemy.engine.base.Engine:1100][MainThread] ()
+ 2015-05-23 16:49:49,614 INFO [sqlalchemy.engine.base.Engine:686][MainThread] COMMIT
+ 2015-05-23 16:49:49,616 INFO [sqlalchemy.engine.base.Engine:646][MainThread] BEGIN (implicit)
+ 2015-05-23 16:49:49,617 INFO [sqlalchemy.engine.base.Engine:1097][MainThread] INSERT INTO models (name, value) VALUES (?, ?)
+ 2015-05-23 16:49:49,617 INFO [sqlalchemy.engine.base.Engine:1100][MainThread] ('one', 1)
+ 2015-05-23 16:49:49,618 INFO [sqlalchemy.engine.base.Engine:686][MainThread] COMMIT
Success! You should now have a ``tutorial.sqlite`` file in your current working
directory. This will be a SQLite database with a single table defined in it
@@ -367,7 +368,7 @@ page. You can read more about the purpose of the icon at
:ref:`debug_toolbar`. It allows you to get information about your
application while you develop.
-Decisions the ``alchemy`` Scaffold Has Made For You
+Decisions the ``alchemy`` Scaffold Has Made for You
=================================================================
Creating a project using the ``alchemy`` scaffold makes
@@ -375,15 +376,15 @@ the following assumptions:
- you are willing to use :term:`SQLAlchemy` as a database access tool
-- you are willing to use :term:`url dispatch` to map URLs to code.
+- you are willing to use :term:`URL dispatch` to map URLs to code
- you want to use ``ZopeTransactionExtension`` and ``pyramid_tm`` to scope
sessions to requests
.. note::
- :app:`Pyramid` supports any persistent storage mechanism (e.g. object
- database or filesystem files, etc). It also supports an additional
+ :app:`Pyramid` supports any persistent storage mechanism (e.g., object
+ database or filesystem files). It also supports an additional
mechanism to map URLs to code (:term:`traversal`). However, for the
- purposes of this tutorial, we'll only be using url dispatch and
+ purposes of this tutorial, we'll only be using URL dispatch and
SQLAlchemy.
diff --git a/docs/tutorials/wiki2/src/views/tutorial/templates/edit.pt b/docs/tutorials/wiki2/src/views/tutorial/templates/edit.pt
index 5f962bbf5..9320e0a50 100644
--- a/docs/tutorials/wiki2/src/views/tutorial/templates/edit.pt
+++ b/docs/tutorials/wiki2/src/views/tutorial/templates/edit.pt
@@ -1,22 +1,20 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
- xmlns:tal="http://xml.zope.org/namespaces/tal">
+<!DOCTYPE html>
+<html lang="en">
<head>
+ <meta charset="utf-8">
<title>${page.name} - Pyramid tutorial wiki (based on
TurboGears 20-Minute Wiki)</title>
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
- <meta name="keywords" content="python web application" />
- <meta name="description" content="pyramid web application" />
+ <meta name="keywords" content="python web application">
+ <meta name="description" content="pyramid web application">
<link rel="shortcut icon"
- href="${request.static_url('tutorial:static/favicon.ico')}" />
+ href="${request.static_url('tutorial:static/favicon.ico')}">
<link rel="stylesheet"
href="${request.static_url('tutorial:static/pylons.css')}"
- type="text/css" media="screen" charset="utf-8" />
+ type="text/css" media="screen">
<!--[if lte IE 6]>
<link rel="stylesheet"
href="${request.static_url('tutorial:static/ie6.css')}"
- type="text/css" media="screen" charset="utf-8" />
+ type="text/css" media="screen">
<![endif]-->
</head>
<body>
@@ -25,7 +23,7 @@
<div class="top-small align-center">
<div>
<img width="220" height="50" alt="pyramid"
- src="${request.static_url('tutorial:static/pyramid-small.png')}" />
+ src="${request.static_url('tutorial:static/pyramid-small.png')}">
</div>
</div>
</div>
@@ -33,9 +31,9 @@
<div class="middle align-right">
<div id="left" class="app-welcome align-left">
Editing <b><span tal:replace="page.name">Page Name Goes
- Here</span></b><br/>
+ Here</span></b><br>
You can return to the
- <a href="${request.application_url}">FrontPage</a>.<br/>
+ <a href="${request.application_url}">FrontPage</a>.<br>
</div>
<div id="right" class="app-welcome align-right"></div>
</div>
@@ -44,8 +42,8 @@
<div class="bottom">
<form action="${save_url}" method="post">
<textarea name="body" tal:content="page.data" rows="10"
- cols="60"/><br/>
- <input type="submit" name="form.submitted" value="Save"/>
+ cols="60"><br>
+ <input type="submit" name="form.submitted" value="Save">
</form>
</div>
</div>
diff --git a/docs/tutorials/wiki2/src/views/tutorial/templates/view.pt b/docs/tutorials/wiki2/src/views/tutorial/templates/view.pt
index 78c0d2d4c..f73d92f0f 100644
--- a/docs/tutorials/wiki2/src/views/tutorial/templates/view.pt
+++ b/docs/tutorials/wiki2/src/views/tutorial/templates/view.pt
@@ -1,22 +1,20 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
- xmlns:tal="http://xml.zope.org/namespaces/tal">
+<!DOCTYPE html>
+<html lang="en">
<head>
+ <meta charset="utf-8">
<title>${page.name} - Pyramid tutorial wiki (based on
TurboGears 20-Minute Wiki)</title>
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
- <meta name="keywords" content="python web application" />
- <meta name="description" content="pyramid web application" />
+ <meta name="keywords" content="python web application">
+ <meta name="description" content="pyramid web application">
<link rel="shortcut icon"
- href="${request.static_url('tutorial:static/favicon.ico')}" />
+ href="${request.static_url('tutorial:static/favicon.ico')}">
<link rel="stylesheet"
href="${request.static_url('tutorial:static/pylons.css')}"
- type="text/css" media="screen" charset="utf-8" />
+ type="text/css" media="screen">
<!--[if lte IE 6]>
<link rel="stylesheet"
href="${request.static_url('tutorial:static/ie6.css')}"
- type="text/css" media="screen" charset="utf-8" />
+ type="text/css" media="screen">
<![endif]-->
</head>
<body>
@@ -25,7 +23,7 @@
<div class="top-small align-center">
<div>
<img width="220" height="50" alt="pyramid"
- src="${request.static_url('tutorial:static/pyramid-small.png')}" />
+ src="${request.static_url('tutorial:static/pyramid-small.png')}">
</div>
</div>
</div>
@@ -33,9 +31,9 @@
<div class="middle align-right">
<div id="left" class="app-welcome align-left">
Viewing <b><span tal:replace="page.name">Page Name
- Goes Here</span></b><br/>
+ Goes Here</span></b><br>
You can return to the
- <a href="${request.application_url}">FrontPage</a>.<br/>
+ <a href="${request.application_url}">FrontPage</a>.<br>
</div>
<div id="right" class="app-welcome align-right"></div>
</div>
diff --git a/docs/tutorials/wiki2/src/views/tutorial/views.py b/docs/tutorials/wiki2/src/views/tutorial/views.py
index b41d4ab40..a3707dab5 100644
--- a/docs/tutorials/wiki2/src/views/tutorial/views.py
+++ b/docs/tutorials/wiki2/src/views/tutorial/views.py
@@ -6,6 +6,7 @@ from pyramid.httpexceptions import (
HTTPFound,
HTTPNotFound,
)
+
from pyramid.view import view_config
from .models import (