Changeset 4433 for waeup/branches/ulif-rewrite
- Timestamp:
- 25 Jul 2009, 11:09:11 (15 years ago)
- Location:
- waeup/branches/ulif-rewrite/src/waeup
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/tables.py
r4432 r4433 37 37 title = 'Departments' 38 38 39 class FacultyTableProvider(CodeAndTitleTableProvider): 40 grok.context(IFacultyContainer) 41 grok.provides(ITableProvider) 42 title = 'Faculties' -
waeup/branches/ulif-rewrite/src/waeup/university/facultycontainer.py
r4412 r4433 11 11 FormWrapMixin) 12 12 from waeup.widgets.interfaces import ITableProvider 13 from waeup.widgets.table import Col, YUITable14 13 15 14 class FacultyContainer(grok.Container): … … 160 159 def render(self): 161 160 return u'<div class="portlet"><a href="manage">Manage faculties</a></div>' 162 163 class FacultyTableProvider(grok.Adapter):164 grok.context(IFacultyContainer)165 grok.provides(ITableProvider)166 167 def __init__(self, context):168 self.context = context169 data = self.context170 cols = (171 Col(172 header='Code', sortable=True,173 data = tuple(['<a href="%s">%s</a>' % (174 data[x].code, data[x].code) for x in data])),175 Col(176 header='Title', sortable=True,177 data = tuple([data.getName(x) for x in data])),178 )179 self.table = YUITable('Faculties', cols=cols)180 181 def getTable(self):182 return self.table
Note: See TracChangeset for help on using the changeset viewer.