Changeset 4156 for waeup/branches/ulif-rewrite
- Timestamp:
- 24 May 2009, 09:33:55 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/university/faculty.py
r4138 r4156 1 1 import grok 2 from zope.component.interfaces import IFactory 2 3 from waeup.interfaces import IFaculty 3 4 from waeup.viewlets import MainArea, LeftSidebar, Index, FormWrapMixin, Manage … … 6 7 grok.implements(IFaculty) 7 8 8 def __init__(self, name=u'Unnamed Faculty', **kw): 9 def __init__(self, 10 title=u'Unnamed Faculty', 11 title_prefix=u'faculty', 12 code=None, **kw): 9 13 super(Faculty, self).__init__(**kw) 10 self.name = name 14 self.title = title 15 self.title_prefix = title_prefix 16 self.code = code 11 17 18 class FacultyFactory(grok.GlobalUtility): 19 """A factory for faculty containers. 20 """ 21 grok.implements(IFactory) 22 grok.name(u'waeup.Faculty') 23 title = u"Create a new faculty.", 24 description = u"This factory instantiates new faculty instances." 25 26 def __call__(self): 27 return Faculty() 28 29 def getInterfaces(self): 30 return implementedBy(Faculty) 31 32 12 33 class DisplayForm(grok.DisplayForm): 13 34 grok.context(IFaculty) … … 24 45 formview_name = 'displayform' # The name of the formview we want 25 46 # to be rendered in this viewlet. 26 27 grok.global_utility(Faculty, provides=IFaculty)28 47 29 48
Note: See TracChangeset for help on using the changeset viewer.