diff options
| author | Chris McDonough <chrism@plope.com> | 2011-01-06 00:52:45 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-01-06 00:52:45 -0500 |
| commit | be72c66a284aa2584f7a960cdf198cb0ec664477 (patch) | |
| tree | b4b90e2ea8b67d8dae9ce18b21bb15f44b86763f /docs/tutorials/wiki/definingviews.rst | |
| parent | 51b2e8cf88a6451e974103c0c2cb7bba29e58b7f (diff) | |
| parent | be3d6f9b1bc55a5c20b04d36a0724f1ec092d169 (diff) | |
| download | pyramid-be72c66a284aa2584f7a960cdf198cb0ec664477.tar.gz pyramid-be72c66a284aa2584f7a960cdf198cb0ec664477.tar.bz2 pyramid-be72c66a284aa2584f7a960cdf198cb0ec664477.zip | |
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/tutorials/wiki/definingviews.rst')
| -rw-r--r-- | docs/tutorials/wiki/definingviews.rst | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/tutorials/wiki/definingviews.rst b/docs/tutorials/wiki/definingviews.rst index 5b0e5dca1..90768f320 100644 --- a/docs/tutorials/wiki/definingviews.rst +++ b/docs/tutorials/wiki/definingviews.rst @@ -230,7 +230,6 @@ Once we're done with the ``view.pt`` template, it will look a lot like the below: .. literalinclude:: src/views/tutorial/templates/view.pt - :linenos: :language: xml .. note:: The names available for our use in a template are always those that @@ -257,23 +256,24 @@ Once we're done with the ``edit.pt`` template, it will look a lot like the below: .. literalinclude:: src/views/tutorial/templates/edit.pt - :linenos: :language: xml Static Assets ------------- -Our templates name a single static asset named ``style.css``. We need to -create this and place it in a file named ``style.css`` within our package's -``static`` directory. This file is a little too long to replicate within the -body of this guide, however it is available `online -<http://github.com/Pylons/pyramid/blob/master/docs/tutorials/wiki/src/views/tutorial/static/style.css>`_. +Our templates name a single static asset named ``pylons.css``. We don't need +to create this file within our package's ``static`` directory because it was +provided at the time we created the project. This file is a little too long to +replicate within the body of this guide, however it is available `online +<http://github.com/Pylons/pyramid/blob/master/docs/tutorials/wiki/src/views/tutorial/static/pylons.css>`_. This CSS file will be accessed via -e.g. ``http://localhost:6543/static/style.css`` by virtue of the call to +e.g. ``http://localhost:6543/static/pylons.css`` by virtue of the call to ``add_static_view`` directive we've made in the ``__init__`` file. Any number and type of static assets can be placed in this directory (or -subdirectories) and are just referred to by URL within templates. +subdirectories) and are just referred to by URL or by using the convenience +method ``static_url`` e.g. ``request.static_url('{{package}}:static/foo.css')`` +within templates. Testing the Views ================= @@ -308,7 +308,7 @@ On Windows: .. code-block:: text - c:\bigfntut\tutorial> ..\Scripts\python setup.py test -q + c:\pyramidtut\tutorial> ..\Scripts\python setup.py test -q The expected result looks something like: |
