# HG changeset patch # User Sylvain Thénault # Date 1316710956 -7200 # Node ID 0ada13ce2e16398510455c3e9b4121f61c41d11c # Parent c071e0b70bf5bffb98f1944436304a540ea0391f [doc] get back baseviews documentation into the code, enhance it and reorganize the module accordingly also properly deprecates SecondaryView as it should have been done a while ago. diff -r c071e0b70bf5 -r 0ada13ce2e16 doc/book/en/devweb/views/baseviews.rst --- a/doc/book/en/devweb/views/baseviews.rst Thu Sep 22 19:02:29 2011 +0200 +++ b/doc/book/en/devweb/views/baseviews.rst Thu Sep 22 19:02:36 2011 +0200 @@ -1,137 +1,17 @@ -.. -*- coding: utf-8 -*- - Base views ---------- -*CubicWeb* provides a lot of standard views, that can be found in +|cubicweb| provides a lot of standard views, that can be found in :mod:`cubicweb.web.views` sub-modules. A certain number of views are used to build the web interface, which apply to one -or more entities. As other appobject, Their identifier is what distinguish them +or more entities. As other appobjects, their identifier is what distinguish them from each others. The most generic ones, found in :mod:`cubicweb.web.views.baseviews`, are described below. -HTML views -~~~~~~~~~~ - -Special views -````````````` - -*noresult* - This view is the default view used when no result has been found - (e.g. empty result set). - -*final* - Display the value of a cell without trasnformation (in case of a non final - entity, we see the eid). Applicable on any result set. - -.. note:: - - `final` entities are merely attributes. - -*null* - This view is the default view used when nothing needs to be rendered. - It is always applicable. - - -Entity views -```````````` - -*incontext, outofcontext* - - Those are used to display a link to an entity, whose label depends on the - entity having to be displayed in or out of context (of another entity): some - entities make sense in the context of another entity. For instance, the - `Version` of a `Project` in forge. So one may expect that 'incontext' will - be called when display a version from within the context of a project, while - 'outofcontext"' will be called in other cases. In our example, the - 'incontext' view of the version would be something like '0.1.2', while the - 'outofcontext' view would include the project name, e.g. 'baz 0.1.2' (since - only a version number without the associated project doesn't make sense if - you don't know yet that you're talking about the famous 'baz' project. |cubicweb| - tries to make guess and call 'incontext'/'outofcontext' nicely. When it can't - know, the 'oneline' view should be used. - - By default it respectively produces the result of `textincontext` and - `textoutofcontext` wrapped in a link leading to the primary view of the - entity. - - -*oneline* - - This view is used when we can't tell if the entity should be considered as - displayed in or out of context. By default it produces the result of `text` - in a link leading to the primary view of the entity. +You'll probably want to customize one or more of the described views which are +default, generic, implementations. -List -````` - -*list* - - This view displays a list of entities by creating a HTML list (`