[boxes] add bw compat on BoxWidget, we mix string and box items until htmlwidgets are gone
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 20 Oct 2010 17:37:00 +0200
changeset 6569 806b53dc5474
parent 6568 bf574e98399a
child 6570 7e9a1a5919e8
[boxes] add bw compat on BoxWidget, we mix string and box items until htmlwidgets are gone
web/htmlwidgets.py
--- a/web/htmlwidgets.py	Wed Oct 20 16:40:03 2010 +0200
+++ b/web/htmlwidgets.py	Wed Oct 20 17:37:00 2010 +0200
@@ -107,7 +107,10 @@
         if self.items:
             self.box_begin_content()
             for item in self.items:
-                item.render(self.w)
+                if hasattr(item, 'render'):
+                    item.render(self.w)
+                else:
+                    self.w(u'<li>%s</li>' % item)
             self.box_end_content()
         self.w(u'</div>')