Author: justi9
Date: 2007-10-12 10:06:33 -0400 (Fri, 12 Oct 2007)
New Revision: 1019
Modified:
mgmt/cumin/python/wooly/widgets.py
Log:
Moves the check and rendering for empty itemsets outside the
render_items call.
Modified: mgmt/cumin/python/wooly/widgets.py
===================================================================
--- mgmt/cumin/python/wooly/widgets.py 2007-10-12 13:46:08 UTC (rev 1018)
+++ mgmt/cumin/python/wooly/widgets.py 2007-10-12 14:06:33 UTC (rev 1019)
@@ -124,21 +124,27 @@
def get_items(self, session, object):
return None
- def render_items(self, session, object):
+ def do_render(self, session, object):
items = self.get_items(session, object)
if items:
- writer = Writer()
-
- for item in items:
- self.item_tmpl.render(session, item, writer)
-
- html = writer.to_string()
+ html = super(ItemSet, self).do_render(session, object)
else:
html = self.render_none(session, object)
return html
+ def render_items(self, session, object):
+ items = self.get_items(session, object)
+ writer = Writer()
+
+ print items
+
+ for item in items:
+ self.item_tmpl.render(session, item, writer)
+
+ return writer.to_string()
+
def render_item_content(self, session, item):
return None