[doc] cubicweb.view documentation (closes: #2099962) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 05 Dec 2011 14:33:26 +0100
branchstable
changeset 8419 dd222fcc85d3
parent 8418 3f87aa655466
child 8420 a4338d00202d
[doc] cubicweb.view documentation (closes: #2099962)
doc/book/en/devweb/views/views.rst
view.py
--- a/doc/book/en/devweb/views/views.rst	Wed May 23 11:05:03 2012 +0200
+++ b/doc/book/en/devweb/views/views.rst	Mon Dec 05 14:33:26 2011 +0100
@@ -35,30 +35,7 @@
 Class `View` (`cubicweb.view`)
 ```````````````````````````````
 
-This class is an abstraction of a view class, used as a base class for
-every renderable object such as views, templates and other user
-interface components.
-
-A `View` is instantiated to render a result set or part of a result
-set. `View` subclasses may be parametrized using the following class
-attributes:
-
-* `templatable` indicates if the view may be embedded in a main
-  template or if it has to be rendered standalone (i.e. pure XML views
-  must not be embedded in the main template of HTML pages)
-
-* if the view is not templatable, it should set the `content_type`
-  class attribute to the correct MIME type (text/xhtml being the
-  default)
-
-* the `category` attribute may be used in the interface to regroup
-  related view kinds together
-
-A view writes to its output stream thanks to its attribute `w` (the
-append method of an `UStreamIO`, except for binary views).
-
-At instantiation time, the standard `_cw` and `cw_rset` attributes are
-added and the `w` attribute will be set at rendering time.
+.. autoclass:: cubicweb.view.View
 
 The basic interface for views is as follows (remember that the result
 set has a tabular structure with rows and columns, hence cells):
@@ -88,12 +65,13 @@
 
 Other basic view classes
 ````````````````````````
-Here are some of the subclasses of `View` defined in `cubicweb.view`
+Here are some of the subclasses of :ref:`View` defined in :ref:`cubicweb.view`
 that are more concrete as they relate to data rendering within the application:
 
-* `EntityView`, view applying to lines or cell containing an entity (e.g. an eid)
-* `StartupView`, start view that does not require a result set to apply to
-* `AnyRsetView`, view applicable to any result set
+.. autoclass:: cubicweb.view.EntityView
+.. autoclass:: cubicweb.view.StartupView
+.. autoclass:: cubicweb.view.EntityStartupView
+.. autoclass:: cubicweb.view.AnyRsetView
 
 Examples of views class
 ```````````````````````
--- a/view.py	Wed May 23 11:05:03 2012 +0200
+++ b/view.py	Mon Dec 05 14:33:26 2011 +0100
@@ -90,19 +90,30 @@
 # base view object ############################################################
 
 class View(AppObject):
-    """abstract view class, used as base for every renderable object such
-    as views, templates, some components...web
+    """This class is an abstraction of a view class, used as a base class for
+    every renderable object such as views, templates and other user interface
+    components.
 
-    A view is instantiated to render a [part of a] result set. View
-    subclasses may be parametred using the following class attributes:
+    A `View` is instantiated to render a result set or part of a result
+    set. `View` subclasses may be parametrized using the following class
+    attributes:
 
-    * `templatable` indicates if the view may be embeded in a main
-      template or if it has to be rendered standalone (i.e. XML for
-      instance)
-    * if the view is not templatable, it should set the `content_type` class
-      attribute to the correct MIME type (text/xhtml by default)
-    * the `category` attribute may be used in the interface to regroup related
-      objects together
+    :py:attr:`templatable` indicates if the view may be embedded in a main
+      template or if it has to be rendered standalone (i.e. pure XML views must
+      not be embedded in the main template of HTML pages)
+    :py:attr:`content_type` if the view is not templatable, it should set the
+      `content_type` class attribute to the correct MIME type (text/xhtml being
+      the default)
+    :py:attr:`category` this attribute may be used in the interface to regroup
+      related objects (view kinds) together
+
+    :py:attr:`paginable`
+
+    :py:attr:`binary`
+
+
+    A view writes to its output stream thanks to its attribute `w` (the
+    append method of an `UStreamIO`, except for binary views).
 
     At instantiation time, the standard `_cw`, and `cw_rset` attributes are
     added and the `w` attribute will be set at rendering time to a write