Author: eallen
Date: 2010-07-06 14:08:09 -0400 (Tue, 06 Jul 2010)
New Revision: 4075
Modified:
mgmt/newdata/wooly/python/wooly/tables.py
Log:
Column headers are now children of columns, so fixup the way we get the header's
container
Modified: mgmt/newdata/wooly/python/wooly/tables.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/tables.py 2010-07-06 17:46:40 UTC (rev 4074)
+++ mgmt/newdata/wooly/python/wooly/tables.py 2010-07-06 18:08:09 UTC (rev 4075)
@@ -167,13 +167,14 @@
def render_href(self, session):
branch = session.branch()
- sel = self.parent.get_selected_column(session)
+ container = self.parent.parent
+ sel = container.get_selected_column(session)
if sel is self.column:
- self.parent.reversed.set \
- (branch, not self.parent.reversed.get(session))
+ container.reversed.set \
+ (branch, not container.reversed.get(session))
- self.parent.scolumn.set(branch, self.column.name)
+ container.scolumn.set(branch, self.column.name)
return branch.marshal()
@@ -181,14 +182,15 @@
return self.column.render_title(session)
def render_sorted_dir(self, session):
- sel = self.parent.get_selected_column(session)
+ container = self.parent.parent
+ sel = container.get_selected_column(session)
if sel is self.column:
- if self.parent.reversed.get(session):
+ if container.reversed.get(session):
return "up"
else:
return "down"
- elif self.parent.reversed.get(session):
+ elif container.reversed.get(session):
return "unsorted_up"
else:
return "unsorted_down"