Changeset 4461 for waeup/branches
- Timestamp:
- 28 Jul 2009, 01:14:12 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/tables.py
r4450 r4461 30 30 return result 31 31 32 def getTable (self, view=None):32 def getTables(self, view=None): 33 33 data = self.data_source 34 34 context_url = '' … … 45 45 ) 46 46 self.table = Table(self.title, cols=cols) 47 return self.table47 return (self.table,) 48 48 49 49 class DepartmentTableProvider(CodeAndTitleTableProvider): … … 73 73 self.data_source = self.context.courses 74 74 75 def getTable(self, view=None): 75 def getTables(self, view=None): 76 data = self.data_source 77 context_url = '' 78 if view: 79 context_url = view.url(self.context) + '/' 80 81 # Create a courses table... 82 cols = ( 83 Col( 84 header='Code', sortable=True, 85 data = tuple([self.getItemURL(view, data[x].code) 86 for x in data])), 87 Col( 88 header='Title', sortable=True, 89 data = tuple([data[x].title for x in data])), 90 ) 91 self.coursetable = Table('Courses', cols=cols) 92 93 # Create a certificates table... 94 self.data_source = self.context.certificates 95 data = self.data_source 96 certcols =( 97 Col( 98 header='Code', sortable=True, 99 data = tuple([self.getItemURL(view, data[x].code) 100 for x in data])), 101 Col( 102 header='Title', sortable=True, 103 data = tuple([data[x].title for x in data])), 104 ) 105 self.certtable = Table('Certificates', cols=certcols) 106 return (self.coursetable, self.certtable) 107 108 class CourseContainerCourseTableProvider(CodeAndTitleTableProvider): 109 grok.context(ICourseContainer) 110 grok.provides(ITableProvider) 111 title = 'Courses' 112 113 def getTables(self, view=None): 76 114 data = self.data_source 77 115 context_url = '' … … 88 126 ) 89 127 self.table = Table(self.title, cols=cols) 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 128 return (self.table,)
Note: See TracChangeset for help on using the changeset viewer.