Changeset 4503 for waeup/branches/ulif-rewrite/src
- Timestamp:
- 31 Jul 2009, 10:22:18 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/university/certificate.py
r4502 r4503 9 9 from waeup.interfaces import (ICertificate, ICertificateContainer, 10 10 ICertificateCourse, ICourse, IDepartment) 11 from waeup.viewlets import FormWrapMixin, Index, Ma inArea11 from waeup.viewlets import FormWrapMixin, Index, Manage, MainArea 12 12 13 13 class Certificate(grok.Container): … … 118 118 # to be rendered in this viewlet. 119 119 120 class ManageForm(grok.EditForm): 121 """Manage the basic properties of a `Department` instance. 122 """ 123 grok.context(ICertificate) 124 form_fields = grok.AutoFields(ICertificate) 125 126 @property 127 def label(self): 128 # Set certificate name as form label 129 return self.form_fields['title'].field.get(self.context) 130 131 @grok.action('Save') 132 def save(self, **data): 133 self.applyData(self.context, **data) 134 return 135 136 @grok.action('Save and return') 137 def saveAndReturn(self, **data): 138 self.applyData(self.context, **data) 139 self.redirect(self.url(self.context)) 140 return 141 142 @grok.action('Cancel') 143 def cancel(self, **data): 144 self.redirect(self.url(self.context)) 145 return 146 147 class ManageCertificate(FormWrapMixin, grok.Viewlet): 148 """A viewlet that renders the `ManageForm`. 149 """ 150 grok.viewletmanager(MainArea) 151 grok.context(ICertificate) 152 grok.view(Manage) 153 grok.require('waeup.manageUniversity') 154 155 formview_name = 'manageform' # The name of the formview we want to 156 # be rendered in this viewlet. 157 120 158 121 159 @grok.subscribe(ICourse, grok.IObjectRemovedEvent)
Note: See TracChangeset for help on using the changeset viewer.