author | Nicolas Chauvat <nicolas.chauvat@logilab.fr> |
Mon, 09 Aug 2010 16:35:49 +0200 | |
branch | stable |
changeset 6079 | bd7e3042791e |
parent 5394 | 105011657405 |
child 6303 | 1aad5389c013 |
permissions | -rw-r--r-- |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
1 |
.. -*- coding: utf-8 -*- |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
2 |
|
5312
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
3 |
Base views |
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
4 |
---------- |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
5 |
|
5312
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
6 |
*CubicWeb* provides a lot of standard views, that can be found in |
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
7 |
:mod:`cubicweb.web.views` and :mod:`cubicweb.web.views.baseviews`. |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
8 |
|
5312
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
9 |
A certain number of views are used to build the web interface, which |
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
10 |
apply to one or more entities. Their identifier is what distinguish |
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
11 |
them from each others and the main ones are: |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
12 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
13 |
HTML views |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
14 |
~~~~~~~~~~ |
5222
ed6905d98a5e
[doc/book] more flesh to views/primary view
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
3258
diff
changeset
|
15 |
|
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
16 |
Special views |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
17 |
````````````` |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
18 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
19 |
*noresult* |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
20 |
This view is the default view used when no result has been found |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
21 |
(e.g. empty result set). |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
22 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
23 |
*final* |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
24 |
Display the value of a cell without trasnformation (in case of a non final |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
25 |
entity, we see the eid). Applicable on any result set. |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
26 |
|
5312
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
27 |
.. note:: |
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
28 |
|
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
29 |
`final` entities are merely attributes. |
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
30 |
|
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
31 |
*null* |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
32 |
This view is the default view used when nothing needs to be rendered. |
5312
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
33 |
It is always applicable. |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
34 |
|
2474
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
35 |
Entity views |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
36 |
```````````` |
5312
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
37 |
|
2474
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
38 |
*incontext, outofcontext* |
3258
6536ee4f37f7
update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2474
diff
changeset
|
39 |
Those are used to display a link to an entity, depending on the |
6536ee4f37f7
update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2474
diff
changeset
|
40 |
entity having to be displayed in or out of context |
5312
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
41 |
(of another entity). By default it respectively produces the |
3258
6536ee4f37f7
update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2474
diff
changeset
|
42 |
result of `textincontext` and `textoutofcontext` wrapped in a link |
6536ee4f37f7
update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2474
diff
changeset
|
43 |
leading to the primary view of the entity. |
2474
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
44 |
|
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
45 |
*oneline* |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
46 |
This view is used when we can't tell if the entity should be considered as |
5312
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
47 |
displayed in or out of context. By default it produces the result of `text` |
2474
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
48 |
in a link leading to the primary view of the entity. |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
49 |
|
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
50 |
List |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
51 |
````` |
5222
ed6905d98a5e
[doc/book] more flesh to views/primary view
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
3258
diff
changeset
|
52 |
|
2474
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
53 |
*list* |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
54 |
This view displays a list of entities by creating a HTML list (`<ul>`) |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
55 |
and call the view `listitem` for each entity of the result set. |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
56 |
|
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
57 |
*listitem* |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
58 |
This view redirects by default to the `outofcontext` view. |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
59 |
|
5222
ed6905d98a5e
[doc/book] more flesh to views/primary view
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
3258
diff
changeset
|
60 |
*sameetypelist* |
2474
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
61 |
This view displays a list of entities of the same type, in HTML section (`<div>`) |
5222
ed6905d98a5e
[doc/book] more flesh to views/primary view
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
3258
diff
changeset
|
62 |
and call the view `sameetypelistitem` for each entity of the result set. |
2474
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
63 |
|
5222
ed6905d98a5e
[doc/book] more flesh to views/primary view
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
3258
diff
changeset
|
64 |
*sameetypelistitem* |
ed6905d98a5e
[doc/book] more flesh to views/primary view
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
3258
diff
changeset
|
65 |
This view redirects by default to the `listitem` view. |
2474
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
66 |
|
3258
6536ee4f37f7
update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2474
diff
changeset
|
67 |
*csv* |
6536ee4f37f7
update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2474
diff
changeset
|
68 |
This view applies to entity groups, which are individually |
6536ee4f37f7
update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2474
diff
changeset
|
69 |
displayed using the `incontext` view. It displays each entity as a |
6536ee4f37f7
update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2474
diff
changeset
|
70 |
coma separated list. It is NOT related to the well-known text file |
6536ee4f37f7
update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2474
diff
changeset
|
71 |
format. |
6536ee4f37f7
update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2474
diff
changeset
|
72 |
|
2474
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
73 |
Text entity views |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
74 |
~~~~~~~~~~~~~~~~~ |
5312
d2dbba898a96
[doc/book] misc on views, docstrings
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5266
diff
changeset
|
75 |
|
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
76 |
*text* |
2474
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
77 |
This is the simplest text view for an entity. By default it returns the |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
78 |
result of the `.dc_title` method, which is cut to fit the |
23e8aa37b2df
fix/enhance baseview doc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2175
diff
changeset
|
79 |
`navigation.short-line-size` property if necessary. |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
80 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
81 |
*textincontext, textoutofcontext* |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
82 |
Similar to the `text` view, but called when an entity is considered out or |
2172
cf8f9180e63e
delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1714
diff
changeset
|
83 |
in context. By default it returns respectively the result of the |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
84 |
methods `.dc_title` and `.dc_long_title` of the entity. |