web/views/primary.py
branchstable
changeset 3705 5cd35123866b
parent 3689 deb13e88e037
child 3720 5376aaadd16b
child 3778 fd5449479584
--- a/web/views/primary.py	Fri Oct 16 15:17:28 2009 +0200
+++ b/web/views/primary.py	Fri Oct 16 15:18:38 2009 +0200
@@ -187,7 +187,8 @@
         self.w(u'<div class="section">')
         if showlabel:
             self.w(u'<h4>%s</h4>' % self.req._(dispctrl['label']))
-        self.wview(dispctrl.get('vid', defaultvid), rset, dispctrl=dispctrl)
+        self.wview(dispctrl.get('vid', defaultvid), rset,
+                   initargs={'dispctrl': dispctrl})
         self.w(u'</div>')
 
     def _render_attribute(self, rschema, value, role='subject'):
@@ -202,12 +203,14 @@
 class RelatedView(EntityView):
     id = 'autolimited'
 
-    def call(self, dispctrl=None, **kwargs):
+    def call(self, **kwargs):
         # nb: rset retreived using entity.related with limit + 1 if any
         # because of that, we known that rset.printable_rql() will return
         # rql with no limit set anyway (since it's handled manually)
-        if dispctrl is not None:
-            limit = dispctrl.get('limit')
+        if 'dispctrl' in self.extra_kwargs:
+            limit = self.extra_kwargs['dispctrl'].get('limit')
+        else:
+            limit = None
         # if not too many entities, show them all in a list
         if limit is None or self.rset.rowcount <= limit:
             if self.rset.rowcount == 1: