Changeset 4450 for waeup/branches/ulif-rewrite/src
- Timestamp:
- 27 Jul 2009, 16:41:57 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/tables.py
r4442 r4450 3 3 import grok 4 4 from waeup.interfaces import (IUniversity, IFacultyContainer, IFaculty, 5 IDepartment )5 IDepartment, ICourseContainer) 6 6 from waeup.widgets.interfaces import ITableProvider 7 7 from waeup.widgets.table import YUITable as Table … … 89 89 self.table = Table(self.title, cols=cols) 90 90 return self.table 91 92 class CourseContainerCourseTableProvider(CodeAndTitleTableProvider): 93 grok.context(ICourseContainer) 94 grok.provides(ITableProvider) 95 title = 'Courses' 96 97 def getTable(self, view=None): 98 data = self.data_source 99 context_url = '' 100 if view: 101 context_url = view.url(self.context) + '/' 102 cols = ( 103 Col( 104 header='Code', sortable=True, 105 data = tuple([self.getItemURL(view, data[x].code) 106 for x in data])), 107 Col( 108 header='Title', sortable=True, 109 data = tuple([data[x].title for x in data])), 110 ) 111 self.table = Table(self.title, cols=cols) 112 return self.table
Note: See TracChangeset for help on using the changeset viewer.