web/views/baseviews.py
changeset 958 6053622aae81
parent 956 ae7044a06efb
child 964 a711c7c185d1
--- a/web/views/baseviews.py	Wed Feb 25 15:55:39 2009 +0100
+++ b/web/views/baseviews.py	Wed Feb 25 18:39:21 2009 +0100
@@ -11,6 +11,8 @@
 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
+from __future__ import with_statement
+
 __docformat__ = "restructuredtext en"
 
 from warnings import warn
@@ -243,9 +245,11 @@
         non-meta in a first step, meta in a second step
         """
         if hasattr(self, 'get_side_boxes_defs'):
-            if rset:
+            sideboxes = [(label, rset) for label, rset in self.get_side_boxes_defs(entity)
+                         if rset]
+            if sideboxes:
                 self.w(u'<table width="100%">')
-                for label, rset in self.get_side_boxes_defs(entity):
+                for label, rset in sideboxes:
                     self.w(u'<tr><td>')
                     self.w(u'<div class="sideRelated">')
                     self.wview('sidebox', rset, title=label)