cubicweb-bootstrap #5102924 Take into account subvid form param in SameETypeListView monkeypatch [open]

It is used when displaying the results of a research. This parameter is dealt with inside ListView (call() method) but not inside SameETypeListView. The behavior should be the same whether the items displayed have the same entity type or not.

The problem is the same in the original version (see ticket https://www.cubicweb.org/ticket/5098473), but since these 2 implementations are different we had to overload twice SameETypeListView, see code:

class SameETypeListViewCW(baseviews.SameETypeListView):
     """Overloaded so that it takes into account subvid form param"""

     def call(self, **kwargs):
         """display a list of entities by calling their <item_vid> view"""
         subvid = self._cw.form.pop('subvid') if 'subvid' in self._cw.form else None
         super(SameETypeListViewCW, self).call(vid=subvid, **kwargs)

     def cell_call(self, row, col=0, vid=None, **kwargs):
         self.wview(self.item_vid, self.cw_rset, row=row, col=col, vid=vid, **kwargs)


class SameETypeListViewBootstrap(baseviews.SameETypeListView):
    """Overloaded so that it takes into account subvid form param"""

    def call(self, **kwargs):
         """display a list of entities by calling their <item_vid> view"""
         subvid = self._cw.form.pop('subvid') if 'subvid' in self._cw.form else None
         if subvid is not None:
             self.item_vid = subvid
         super(SameETypeListViewBootstrap, self).call(**kwargs)
prioritynormal
typeenhancement
done in<not specified>
closed by<not specified>