--- a/doc/book/en/development/devweb/views.rst Tue Jul 28 23:21:39 2009 +0200
+++ b/doc/book/en/development/devweb/views.rst Tue Jul 28 23:48:19 2009 +0200
@@ -1,3 +1,6 @@
+
+.. _Views:
+
Views
-----
@@ -76,8 +79,7 @@
- Using `templatable`, `content_type` and HTTP cache configuration
-.. code-block:: python
-
+.. sourcecode:: python
class RSSView(XMLView):
id = 'rss'
@@ -88,11 +90,9 @@
cache_max_age = 60*60*2 # stay in http cache for 2 hours by default
-
- Using custom selector
-.. code-block:: python
-
+.. sourcecode:: python
class SearchForAssociationView(EntityView):
"""view called by the edition view when the user asks
@@ -112,9 +112,9 @@
We'll show you now an example of a ``primary`` view and how to customize it.
If you want to change the way a ``BlogEntry`` is displayed, just override
-the method ``cell_call()`` of the view ``primary`` in ``BlogDemo/views.py`` ::
+the method ``cell_call()`` of the view ``primary`` in ``BlogDemo/views.py``:
-.. code-block:: python
+.. sourcecode:: python
from cubicweb.view import EntityView
from cubicweb.selectors import implements
@@ -148,7 +148,7 @@
Let us now improve the primary view of a blog
-.. code-block:: python
+.. sourcecode:: python
class BlogPrimaryView(EntityView):
id = 'primary'
@@ -215,9 +215,9 @@
[FILLME]
-
XML views, binaries...
----------------------
+
For views generating other formats than HTML (an image generated dynamically
for example), and which can not simply be included in the HTML page generated
by the main template (see above), you have to: