[rhmessaging-commits] rhmessaging commits: r3437 - mgmt/trunk/wooly/python/wooly.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Jun 9 16:20:29 EDT 2009


Author: eallen
Date: 2009-06-09 16:20:29 -0400 (Tue, 09 Jun 2009)
New Revision: 3437

Modified:
   mgmt/trunk/wooly/python/wooly/tables.py
Log:
Allow classes derived from ItemTableColumn to add their own class names to the <td> tag.

Modified: mgmt/trunk/wooly/python/wooly/tables.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/tables.py	2009-06-08 18:55:08 UTC (rev 3436)
+++ mgmt/trunk/wooly/python/wooly/tables.py	2009-06-09 20:20:29 UTC (rev 3437)
@@ -114,8 +114,16 @@
     def get_column_key(self, session):
         return self.name
 
+    def get_class_list(self, session):
+        """ allow derived classes to add their own classes """
+        cls = list()
+        if self.alignment == "right":
+            cls.append("ralign");
+        return cls
+
     def get_class_attr(self, session):
-        return self.alignment == "right" and "class=\"ralign\"" or ""
+        cls = self.get_class_list(session)
+        return cls and "class=\"%s\"" % " ".join(cls) or ""
 
     def do_render(self, session, data):
         content = self.render_content(session, data)




More information about the rhmessaging-commits mailing list