Changeset 4431
- Timestamp:
- 25 Jul 2009, 10:57:49 (15 years ago)
- Location:
- waeup/branches/ulif-rewrite/src/waeup
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/university/faculty.py
r4429 r4431 8 8 Manage, Add) 9 9 from waeup.widgets.interfaces import ITableProvider 10 from waeup.widgets.table import YUITable, Col11 10 12 11 class Faculty(grok.Container): … … 75 74 76 75 def update(self): 77 self.table = ITableProvider(self.context).getTable( )76 self.table = ITableProvider(self.context).getTable(view=self.view) 78 77 self.table.need() 79 78 … … 170 169 def render(self): 171 170 return u'<div class="portlet"><a href="add">Add department</a></div>' 172 173 class DepartmentTableProvider(grok.Adapter):174 grok.context(IFaculty)175 grok.provides(ITableProvider)176 177 def __init__(self, context):178 self.context = context179 data = self.context180 cols = (181 Col(182 header='Code', sortable=True,183 data = tuple(['<a href="%s">%s</a>' % (184 data[x].code, data[x].code) for x in data])),185 Col(186 header='Title', sortable=True,187 data = tuple([data.getName(x) for x in data])),188 )189 self.table = YUITable('Departments', cols=cols)190 191 def getTable(self):192 return self.table193
Note: See TracChangeset for help on using the changeset viewer.