Changeset 3910 for waeup/branches/ulif-rewrite
- Timestamp:
- 6 Feb 2009, 16:36:40 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/university/facultycontainer.py
r3884 r3910 5 5 from waeup.basecontainer import BaseContainer 6 6 from waeup.interfaces import IFacultyContainer 7 from waeup.viewlets import MainArea, LeftSidebar, Index, Add 7 from waeup.viewlets import MainArea, LeftSidebar, Index, Add, FormWrapMixin 8 8 from interfaces import IFaculty 9 9 from faculty import Faculty … … 69 69 self.redirect(self.url(self.context)) 70 70 71 class AddFaculty(grok.Viewlet): 71 72 class AddFaculty(FormWrapMixin, grok.Viewlet): 72 73 """A viewlet that wraps the `AddFacultyForm`. 73 74 """ … … 76 77 grok.view(Add) 77 78 grok.require('waeup.manageUniversity') 78 79 def update(self, **data):80 self.form = getMultiAdapter((self.context, self.request),81 name='addfacultyform')82 result = self.form.update_form()83 if self.request.method == 'POST':84 #app = get_application(self.context)85 #self.__parent__.redirect(self.__parent__.url(obj=app))86 pass87 return88 79 89 def render(self): 90 result = self.form.render() 91 try: 92 # strip all except the form part... 93 result = re.match('^.+\(<form[^\>]+>.*</form>).+$', result, 94 re.DOTALL).groups()[0] 95 except: 96 # except there is no such part... 97 pass 98 return result 80 formview_name = 'addfacultyform' # The name of the formview we 81 # want to be rendered in this 82 # viewlet. 83 99 84 100 85 class AddFacultyLink(grok.Viewlet):
Note: See TracChangeset for help on using the changeset viewer.