Changeset 627 for WAeUP_SRP/trunk
- Timestamp:
- 9 Oct 2006, 10:02:41 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Accommodation.py
r626 r627 23 23 portal_type = meta_type 24 24 security = ClassSecurityInfo() 25 25 26 26 security.declareProtected(View,"Title") 27 27 def Title(self): 28 28 """compose title""" 29 return "Accommodation Halls"29 return "Accommodation" 30 30 31 31 security.declareProtected(ModifyPortalContent,"generateFreeBedsList") ###( … … 52 52 if h.which_sex: 53 53 sex = 'female' 54 for block in range(1,int(h.nr_of_blocks) ):55 for floor in range(1,int(h.nr_of_floors) ):56 for room in range(1,int(h.rooms_per_floor) ):54 for block in range(1,int(h.nr_of_blocks)+1): 55 for floor in range(1,int(h.nr_of_floors)+1): 56 for room in range(1,int(h.rooms_per_floor)+1): 57 57 for bed in 'ABCDEFGH'[:int(h.beds_per_room)]: 58 58 room_nr = floor*100 + room … … 69 69 uid = '%s_%d_%d_%s' % (hall.getId(),block,room_nr,bed) 70 70 try: 71 freelist.addRecord(bed = uid, bed_type = bt,hall = hall.getId())71 freelist.addRecord(bed = uid, bed_type = bt,hall = hall.getId()) 72 72 count +=1 73 73 generated.append('"%(uid)s","%(bt)s"' % vars()) 74 74 except ValueError: 75 freelist.modifyRecord(bed = uid, bed_type = bt,hall =hall.getId())75 #freelist.modifyRecord(bed = uid, bed_type = bt,hall =hall.getId()) 76 76 pass 77 77 hall_gen['count']= count -
WAeUP_SRP/trunk/profiles/default/types.xml
r622 r627 16 16 <object name="Semester" meta_type="CPS Flexible Type Information"/> 17 17 <object name="Student" meta_type="CPS Flexible Type Information"/> 18 <object name="StudentAccommodation" meta_type="CPS Flexible Type Information"/> 18 19 <object name="StudentStudyLevel" meta_type="CPS Flexible Type Information"/> 19 20 <object name="StudentStudyCourse" meta_type="CPS Flexible Type Information"/> -
WAeUP_SRP/trunk/skins/waeup_accommodation/acco_hall_view.pt
r622 r627 11 11 <h3 tal:content="here/title_or_id" /> 12 12 <div tal:condition="nothing" tal:content="info/container_path"/> 13 <table tal:condition="info/bed_types" 14 tal:define="bed_types info/bed_types"> 15 <tr> 16 <th>Bed Type</th> 17 <th>Beds</th> 18 </tr> 19 <tr tal:repeat="bt bed_types"> 20 <td tal:content="bt/name" /> 21 <td tal:content="bt/count" /> 22 </tr> 23 <tr><td> </td></tr> 24 </table> 13 25 </metal:block> 14 26 <metal:main fill-slot="main"> -
WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallsInfo.py
r626 r627 38 38 bed_types = pa.uniqueValuesFor('bed_type') 39 39 bt_list = [] 40 bt_names = context.getBedTypeNames() 40 41 for bt in bed_types: 41 42 res = pa(bed_type=bt) 42 bt_list.append({'name': bt , 'count': len(res)})43 bt_list.append({'name': bt_names[bt], 'count': len(res)}) 43 44 info['bed_types'] = bt_list 44 45 reserved = pa.uniqueValuesFor('student') -
WAeUP_SRP/trunk/skins/waeup_accommodation/getHallInfo.py
r622 r627 17 17 path_info = request.get('PATH_INFO').split('/') 18 18 mtool = context.portal_membership 19 19 pa = context.portal_accommodation 20 20 info = {} 21 21 #dep_id = request.get('PATH_TRANSLATED').split('/')[-2] … … 26 26 info['choosen_ids'] = request.get('ids',[]) 27 27 info['doc'] = context.getContent() 28 bed_types = pa.uniqueValuesFor('bed_type') 29 bt_list = [] 30 bt_names = context.getBedTypeNames() 31 for bt in bed_types: 32 res = pa(bed_type=bt,hall=context.getId()) 33 bt_list.append({'name': bt_names[bt], 'count': len(res)}) 34 info['bed_types'] = bt_list 35 28 36 return info
Note: See TracChangeset for help on using the changeset viewer.