Changeset 3896 for waeup/branches/ulif-rewrite/src
- Timestamp:
- 30 Jan 2009, 19:01:04 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/app.py
r3893 r3896 6 6 from waeup.interfaces import (IUniversity, IStudentContainer, IHostelContainer, 7 7 IFacultyContainer) 8 from waeup.viewlets import MainArea, LeftSidebar, Index, Manage 8 from waeup.viewlets import MainArea, LeftSidebar, Index, Manage, FormWrapMixin 9 9 10 10 class University(grok.Application, grok.Container): … … 47 47 return 48 48 49 class ManageUniversity( grok.Viewlet):49 class ManageUniversity(FormWrapMixin, grok.Viewlet): 50 50 """A viewlet that renders the `ManageForm`. 51 51 """ … … 55 55 grok.require('waeup.manageUniversity') 56 56 57 def update(self): 58 self.form = getMultiAdapter((self.context, self.request), 59 name='manageform') 60 self.form.update_form() 61 if self.request.method == 'POST': 62 #app = get_application(self.context) 63 #self.__parent__.redirect(self.__parent__.url(obj=app)) 64 pass 57 formview_name = 'manageform' # The name of the formview we want to 58 # be rendered in this viewlet. 65 59 66 def render(self):67 result = self.form.render()68 try:69 # strip all except the form part...70 result = re.match('^.+\(<form[^\>]+>.*</form>).+$', result,71 re.DOTALL).groups()[0]72 except:73 # except there is no such part...74 pass75 return result76 return self.form.render()77 78 79 80 60 class Content(grok.Viewlet): 81 61 grok.viewletmanager(MainArea)
Note: See TracChangeset for help on using the changeset viewer.