- Timestamp:
- 24 Apr 2009, 11:21:49 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/app.py
r4039 r4074 1 1 import grok 2 2 import re 3 from zope.app.authentication.authentication import PluggableAuthentication 4 from zope.app.security.interfaces import IAuthentication 3 5 from zope.component import getUtility, getMultiAdapter 4 6 from zope.interface import Interface … … 7 9 IFacultyContainer) 8 10 from waeup.viewlets import MainArea, LeftSidebar, Index, Manage, FormWrapMixin 11 from waeup.authentication import setup_authentication 9 12 10 13 class University(grok.Application, grok.Container): … … 12 15 """ 13 16 grok.implements(IUniversity) 17 # Setup authentication for this app. Note: this is only 18 # initialized, when a new instance of this app is created. 19 grok.local_utility( 20 PluggableAuthentication, provides = IAuthentication, 21 setup = setup_authentication) 14 22 15 23 def __init__(self, name=u'Sample University', **kw): … … 40 48 41 49 form_fields = grok.AutoFields(IUniversity) 50 grok.require('waeup.manageUniversity') 42 51 43 52 @grok.action('Save') … … 57 66 return 58 67 59 class ManageUniversity(FormWrapMixin, grok.Viewlet): 68 class ManageUniversity(Manage): 69 grok.name('manage') 70 grok.context(IUniversity) 71 grok.require('waeup.manageUniversity') 72 73 def render(self, *args, **kw): 74 return super(ManageUniversity, self).render(*args, **kw) 75 76 class ManageUniversityMain(FormWrapMixin, grok.Viewlet): 60 77 """A viewlet that renders the `ManageForm`. 61 78 """
Note: See TracChangeset for help on using the changeset viewer.