Ignore:
Timestamp:
28 Sep 2006, 07:18:24 (18 years ago)
Author:
Henrik Bettermann
Message:

email field added to personal schema and layout
title method for AccoFolder? added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Accommodation.py

    r502 r575  
    66from Products.CMFCore.permissions import View
    77from Products.CMFCore.permissions import ModifyPortalContent
    8 from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder 
    9 #from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument 
    10 from Products.CPSDocument.CPSDocument import CPSDocument 
    11 from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder 
     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
    1212from Products.WAeUP_SRP.WAeUPTables import AccommodationTable
    1313
    1414class AccoFolder(CPSDocument): ###(
    1515    """
    16     WAeUP AccoFolder containing Accommodation halls 
     16    WAeUP AccoFolder containing Accommodation halls
    1717    """
    1818    meta_type = 'AccoFolder'
     
    2020    security = ClassSecurityInfo()
    2121   
     22    security.declareProtected(View,"Title")
     23    def Title(self):
     24        """compose title"""
     25        return "Accommodation"   
     26
    2227    security.declareProtected(ModifyPortalContent,"generateFreeBedsList") ###(
    2328    def generateFreeBedsList(self):
     
    2631        """
    2732        freelist = AccommodationTable()
    28         l = self.portal_catalog({'meta_type': "Accommodation"}) 
     33        l = self.portal_catalog({'meta_type': "Accommodation"})
    2934        halls = []
    3035        for h in l:
     
    5257                            elif bed in h.beds_for_final:
    5358                                bt = 'fi'
    54                             bt = "%(sex)s_%(bt)s" % vars() 
     59                            bt = "%(sex)s_%(bt)s" % vars()
    5560                            uid = '%s_%d_%s' % (hall.getId(),room_nr,bed)
    5661                            print bt,uid
     
    6065                            except ValueError,e:
    6166                                freelist.deleteRecord(uid)
    62                    
     67
    6368        return self.accommodation.academics_contents()
    6469
     
    7580class Accommodation(CPSDocument): ###(
    7681    """
    77     WAeUP Accommodation containing Departments 
     82    WAeUP Accommodation containing Departments
    7883    """
    7984    meta_type = 'Accommodation'
    8085    portal_type = meta_type
    8186    security = ClassSecurityInfo()
    82    
     87
    8388    security.declareProtected(View,"Title") ###(
    8489    def Title(self):
     
    9196
    9297###)
    93                
     98
    9499InitializeClass(Accommodation)
    95100
Note: See TracChangeset for help on using the changeset viewer.