Changeset 575 for WAeUP_SRP/trunk/Accommodation.py
- Timestamp:
- 28 Sep 2006, 07:18:24 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Accommodation.py
r502 r575 6 6 from Products.CMFCore.permissions import View 7 7 from 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 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 12 12 from Products.WAeUP_SRP.WAeUPTables import AccommodationTable 13 13 14 14 class AccoFolder(CPSDocument): ###( 15 15 """ 16 WAeUP AccoFolder containing Accommodation halls 16 WAeUP AccoFolder containing Accommodation halls 17 17 """ 18 18 meta_type = 'AccoFolder' … … 20 20 security = ClassSecurityInfo() 21 21 22 security.declareProtected(View,"Title") 23 def Title(self): 24 """compose title""" 25 return "Accommodation" 26 22 27 security.declareProtected(ModifyPortalContent,"generateFreeBedsList") ###( 23 28 def generateFreeBedsList(self): … … 26 31 """ 27 32 freelist = AccommodationTable() 28 l = self.portal_catalog({'meta_type': "Accommodation"}) 33 l = self.portal_catalog({'meta_type': "Accommodation"}) 29 34 halls = [] 30 35 for h in l: … … 52 57 elif bed in h.beds_for_final: 53 58 bt = 'fi' 54 bt = "%(sex)s_%(bt)s" % vars() 59 bt = "%(sex)s_%(bt)s" % vars() 55 60 uid = '%s_%d_%s' % (hall.getId(),room_nr,bed) 56 61 print bt,uid … … 60 65 except ValueError,e: 61 66 freelist.deleteRecord(uid) 62 67 63 68 return self.accommodation.academics_contents() 64 69 … … 75 80 class Accommodation(CPSDocument): ###( 76 81 """ 77 WAeUP Accommodation containing Departments 82 WAeUP Accommodation containing Departments 78 83 """ 79 84 meta_type = 'Accommodation' 80 85 portal_type = meta_type 81 86 security = ClassSecurityInfo() 82 87 83 88 security.declareProtected(View,"Title") ###( 84 89 def Title(self): … … 91 96 92 97 ###) 93 98 94 99 InitializeClass(Accommodation) 95 100
Note: See TracChangeset for help on using the changeset viewer.