Changeset 9743
- Timestamp:
- 30 Nov 2012, 09:02:08 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r9738 r9743 2000 2000 hitlist = [] 2001 2001 for ticket in coursetickets: 2002 # XXX: If students have registered the same courses twice 2003 # they will be listed twice. 2002 2004 hitlist.append(StudentQueryResultItem(ticket.student, view=self)) 2003 return hitlist2004 2005 class ShowStudentsInDepartmentPage(FilterStudentsInDepartmentPage):2006 """Page that lists all students in the department.2007 """2008 grok.context(IDepartment)2009 grok.require('waeup.showStudents')2010 grok.name('showdepstudents')2011 grok.template('showstudentspage')2012 pnav = 12013 label = _('Students')2014 2015 @property2016 def getStudents(self):2017 hitlist = searchstudents(query=self.context.code,2018 searchtype='depcode', view=self)2019 return hitlist2020 2021 def update(self, *args, **kw):2022 datatable.need()2023 return2024 2025 class ShowStudentsInCertificatePage(ShowStudentsInDepartmentPage):2026 """Page that lists all students studying a certificate.2027 """2028 grok.context(ICertificate)2029 grok.name('showcertstudents')2030 2031 @property2032 def getStudents(self):2033 hitlist = searchstudents(query=self.context.code,2034 searchtype='certcode', view=self)2035 return hitlist2036 2037 class ShowStudentsInCoursePage(ShowStudentsInDepartmentPage):2038 """Page that lists all students studying a certificate.2039 """2040 grok.context(ICourse)2041 grok.name('showcoursestudents')2042 2043 @property2044 def getStudents(self):2045 hitlist = []2046 cat = queryUtility(ICatalog, name='coursetickets_catalog')2047 results = cat.searchResults(code=(self.context.code, self.context.code))2048 for result in results:2049 hitlist.append(StudentQueryResultItem(result.student, view=self))2050 2005 return hitlist 2051 2006
Note: See TracChangeset for help on using the changeset viewer.