source: WAeUP_SRP/trunk/Accommodation.py @ 371

Last change on this file since 371 was 200, checked in by joachim, 19 years ago

=removed files not necessary

  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#-*- mode: python; mode: fold -*-
2from Globals import InitializeClass
3from AccessControl import ClassSecurityInfo
4
5from Products.CMFCore.utils import UniqueObject, getToolByName
6from Products.CMFCore.permissions import View
7from Products.CMFCore.permissions import ModifyPortalContent
8from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder
9#from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument
10from Products.CPSDocument.CPSDocument import CPSDocument
11from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder
12
13class AccoFolder(CPSDocument): ###(
14    """
15    WAeUP AccoFolder containing Accommodation halls
16    """
17    meta_type = 'AccoFolder'
18    portal_type = meta_type
19    security = ClassSecurityInfo()
20   
21
22InitializeClass(AccoFolder)
23
24def addAccoFolder(container, id, REQUEST=None, **kw):
25    """Add a AccoFolder."""
26    ob = AccoFolder(id, **kw)
27    return CPSBase_adder(container, ob, REQUEST=REQUEST)
28###)
29
30
31class Accommodation(CPSDocument): ###(
32    """
33    WAeUP Accommodation containing Departments
34    """
35    meta_type = 'Accommodation'
36    portal_type = meta_type
37    security = ClassSecurityInfo()
38   
39    security.declareProtected(View,"Title")
40    def Title(self):
41        """compose title"""
42        content = self.getContent()
43        heading = getattr(content,'heading',None)
44        if heading is None:
45            return self.title
46        return heading
47   
48InitializeClass(Accommodation)
49
50def addAccommodation(container, id, REQUEST=None, **kw):
51    """Add a Accommodation."""
52    ob = Accommodation(id, **kw)
53    return CPSBase_adder(container, ob, REQUEST=REQUEST)
54###)
Note: See TracBrowser for help on using the repository browser.