[Cubicweb] primaryview_display_ctrl use can break 'see all' link

Sylvain Thénault sylvain.thenault at logilab.fr
Mon Sep 20 14:58:33 CEST 2010

On 19 septembre 20:13, Alexandre Fayolle wrote:
> Maybe this is known, but the CW forge is unreachable for now. 
> In a cube I'm working on, I'm trying to use the following:
> uicfg.primaryview_section.tag_subject_of(('Bibliotheque', 'conserve', '*'),
>                                                                  'relations')
> #uicfg.primaryview_display_ctrl.tag_subject_of(('Bibliotheque', 'conserve', 
> '*'), 
>                                                     {'vid': 'cotebibliview'})
> With the second line commented out, if I display the primary view of a 
> Bibliotheque with more than a few conserve relations, I see the [see them all] 
> link, but not the view I want. If I uncomment the second line, I get the 
> correct view, but not the [see them all] link so I don't have all the items I 
> want. 

I would have said that in such case, you would get all items (hence no view all links).
Though I may see what's triggering this.
> If this is not a known bug, I'll add a ticket on the forge when it is back up. 

Not known anyway.
> Question: how can I tell CW that I always want to see all the related elements 
> on the "Bibliotheque conserve" relation in the primary view? 

Specifying custom 'vid' in primaryview_display_ctrl as you've done should be enough.
Provided we fix the bug :)

Now to tell a bit more about this:

by default, the primary view use 'autolimited' as vid. This is the view that will
use comma separated values or list view and limit your rset if there is too much
items in it (and generate the "view all" link in this case).

You can control this view by setting the following values in the pvdc rtag:

* 'limit', maximum number of entities to display. The value of the
  'navigation.related-limit'  cwproperty is used by default (which is 8 by default).
  If None, no limit.

* 'use_list_limit', number of entities until which they should be display as a list
  (eg using the 'list' view). Below that limit, the 'csv' view is used. If None,
  display using 'csv' anyway.

* 'subvid', the subview identifier (eg view that should be used of each item in the 

That should go in the book if not already there...
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org

More information about the Cubicweb mailing list