Changeset 4510 for waeup/branches/ulif-rewrite
- Timestamp:
- 31 Jul 2009, 23:47:43 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/university/course.py
r4449 r4510 6 6 from waeup.interfaces import ICourse 7 7 from waeup.viewlets import MainArea, Index, Manage, FormWrapMixin 8 from waeup.utils.helpers import getName 8 9 9 10 class Course(grok.Model): … … 51 52 grok.view(Index) 52 53 grok.require('waeup.manageUniversity') 54 grok.order(3) 53 55 54 56 formview_name = 'displayform' # The name of the formview we want 55 57 # to be rendered in this viewlet. 56 58 59 class ContentHeader(grok.Viewlet): 60 """A viewlet that renders the faculty, department and course title. 61 """ 62 grok.viewletmanager(MainArea) 63 grok.context(ICourse) 64 grok.view(Index) 65 grok.order(2) 66 67 def render(self): 68 return '''<h5>%s</h5><h4>%s</h4><h3>%s</h3>''' % ( 69 getName(self.context.__parent__.__parent__.__parent__), 70 getName(self.context.__parent__.__parent__), 71 self.context.title) 72 57 73 class ManageForm(grok.EditForm): 58 74 """Manage the basic properties of a `Course` instance.
Note: See TracChangeset for help on using the changeset viewer.