Changeset 4081
- Timestamp:
- 25 Apr 2009, 13:45:14 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/hostel/hostelcontainer.py
r3942 r4081 1 1 import grok 2 from zope.component.interfaces import IFactory 3 from zope.interface import implementedBy 2 4 from waeup.interfaces import IHostelContainer, IHostel 3 5 from waeup.viewlets import MainArea, Index, Add, FormWrapMixin … … 21 23 return id 22 24 25 class HostelContainerFactory(grok.GlobalUtility): 26 """A factory for faculty containers. 27 """ 28 grok.implements(IFactory) 29 grok.name(u'waeup.HostelContainer') 30 title = u"Create a new hostel container.", 31 description = u"This factory instantiates new hostel containers." 23 32 24 # We register HostelContainer as a utility. This way we can 25 # call getUtility(IHostelContainer) from anywhere in the code and 26 # get an instance of HostelContainer (without importing it). 27 grok.global_utility(HostelContainer, provides=IHostelContainer) 33 def __call__(self): 34 return HostelContainer() 35 36 def getInterfaces(self): 37 return implementedBy(HostelContainer) 38 28 39 29 40 class AddHostelForm(grok.AddForm):
Note: See TracChangeset for help on using the changeset viewer.