source: WAeUP_SRP/branches/joachim-event-branch/University.py @ 5913

Last change on this file since 5913 was 821, checked in by joachim, 18 years ago

make hostel allocation work

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1from Globals import InitializeClass,HTMLFile
2from AccessControl import ClassSecurityInfo
3from Products.ZCatalog.ZCatalog import ZCatalog
4
5from Products.CMFCore.utils import getToolByName
6from Products.CMFCore.permissions import View
7from Products.CMFCore.permissions import ModifyPortalContent
8from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder
9from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument
10from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder
11from Products.CPSDocument.CPSDocument import CPSDocument
12
13#
14# The WAeUP BaseContainer
15#
16class University(CPSDocument):
17    """
18    Container for the various WAeUP containers
19    """
20    meta_type = 'University'
21    portal_type = meta_type
22    security = ClassSecurityInfo()
23       
24    security.declarePublic('getHallTitle')
25    def getHallTitle(self,hall):
26        """get the Hall Title"""
27        res = ZCatalog.searchResults(self.portal_catalog,portal_type="AccoHall",id=hall)
28        if res and len(res) == 1:
29            return res[0].Title
30        return hall
31
32InitializeClass(University)
33
34def addUniversity(container, id, REQUEST=None, **kw):
35    """Add a University"""
36    ob = University(id, **kw)
37    return CPSBase_adder(container, ob, REQUEST=REQUEST)
38
Note: See TracBrowser for help on using the repository browser.