# HG changeset patch # User Sylvain Thénault # Date 1284738955 -7200 # Node ID 17cd9ae3d2d529374dd5133cadbe03ed9618886f # Parent f4a0282c31a57681f5a89d56cf8234c171804e7d [primary view] introducing use_list_limit in pvdc fix reledit regression on the way (introducted a few changesets ago) diff -r f4a0282c31a5 -r 17cd9ae3d2d5 web/views/primary.py --- a/web/views/primary.py Fri Sep 17 17:46:47 2010 +0200 +++ b/web/views/primary.py Fri Sep 17 17:55:55 2010 +0200 @@ -301,14 +301,15 @@ def call(self, **kwargs): if 'dispctrl' in self.cw_extra_kwargs: limit = self.cw_extra_kwargs['dispctrl'].get('limit') + list_limit = self.cw_extra_kwargs['dispctrl'].get('use_list_limit', 5) subvid = self.cw_extra_kwargs['dispctrl'].get('subvid', 'incontext') else: - limit = None + limit = list_limit = None subvid = 'incontext' if limit is None or self.cw_rset.rowcount <= limit: if self.cw_rset.rowcount == 1: self.wview(subvid, self.cw_rset, row=0) - elif 1 < self.cw_rset.rowcount <= 5: + elif list_limit is None or 1 < self.cw_rset.rowcount <= list_limit: self.wview('csv', self.cw_rset, subvid=subvid) else: self.w(u'
') @@ -318,12 +319,18 @@ else: rql = self.cw_rset.printable_rql() self.cw_rset.limit(limit) # remove extra entity - self.w(u'
') - self.wview('simplelist', self.cw_rset, subvid=subvid) - self.w(u'[%s]' % ( - xml_escape(self._cw.build_url(rql=rql, vid=subvid)), - self._cw._('see them all'))) - self.w(u'
') + if list_limit is None: + self.wview('csv', self.cw_rset, subvid=subvid) + self.w(u'[%s]' % ( + xml_escape(self._cw.build_url(rql=rql, vid=subvid)), + self._cw._('see them all'))) + else: + self.w(u'
') + self.wview('simplelist', self.cw_rset, subvid=subvid) + self.w(u'[%s]' % ( + xml_escape(self._cw.build_url(rql=rql, vid=subvid)), + self._cw._('see them all'))) + self.w(u'
') class URLAttributeView(EntityView):